Adding array out of bound check for timestamps comparison.
authorrtrimana <rtrimana@uci.edu>
Thu, 18 Oct 2018 20:20:30 +0000 (13:20 -0700)
committerrtrimana <rtrimana@uci.edu>
Thu, 18 Oct 2018 20:20:30 +0000 (13:20 -0700)
python_ml/validate-detection.py

index b22e0a381cfdd113720a14b45d268b5c0b7a80c2..663dc784d81bcc84c961660374bbb1674a795c3a 100644 (file)
@@ -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