From 9b4324ad84f43bc2b2aaff6fd549193ad37f8f9c Mon Sep 17 00:00:00 2001 From: rtrimana Date: Thu, 18 Oct 2018 13:20:30 -0700 Subject: [PATCH] Adding array out of bound check for timestamps comparison. --- python_ml/validate-detection.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/python_ml/validate-detection.py b/python_ml/validate-detection.py index b22e0a3..663dc78 100644 --- a/python_ml/validate-detection.py +++ b/python_ml/validate-detection.py @@ -1,10 +1,14 @@ from datetime import datetime -path = "/scratch/July-2018/evaluation/" -device = "dlink" -fileExperiment = "dlink-plug-8hr-data-oct-8-2018.timestamps" -fileDetection = "dlink-plug.detection.timestamps" +path = "/scratch/July-2018/training/" +device = "dlink-plug/self-test" +#fileExperiment = "dlink-plug-8hr-data-oct-8-2018.timestamps" +#fileDetection = "dlink-plug.detection.timestamps" +#fileExperiment = "dlink-siren-aug-14-2018.timestamps" +#fileDetection = "dlink-siren.2018-08-14_experiment.phone_signature_detected_events.txt" +fileExperiment = "dlink-plug-oct-17-2018.timestamps" +fileDetection = "detection-on-training-device-side" TIME_WINDOW = 15 # detection/signature window of 15 seconds #NEG_TIME_WINDOW = -15 # detection/signature window of 15 seconds @@ -32,6 +36,9 @@ else: i = 0 j = 0 while i < maxTimestamps: + if(len(tsExperimentList) <= i or len(tsDetectionList) <= j): + break; + tsE = tsExperimentList[i] tsD = tsDetectionList[j] # Detection is always a bit later than training trigger -- 2.34.1