diff scripts/process.py @ 987:f026ce2af637

found bug with direct ttc computation
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Wed, 07 Mar 2018 23:37:00 -0500
parents 3be8aaa47651
children dc0be55e2bf5
line wrap: on
line diff
--- a/scripts/process.py	Tue Mar 06 23:54:10 2018 -0500
+++ b/scripts/process.py	Wed Mar 07 23:37:00 2018 -0500
@@ -13,6 +13,7 @@
 parser = argparse.ArgumentParser(description='This program manages the processing of several files based on a description of the sites and video data in an SQLite database following the metadata module.')
 parser.add_argument('--db', dest = 'metadataFilename', help = 'name of the metadata file', required = True)
 parser.add_argument('--videos', dest = 'videoIds', help = 'indices of the video sequences', nargs = '*', type = int)
+parser.add_argument('--prediction-method', dest = 'predictionMethod', help = 'prediction method (constant velocity (cvd: vector computation (approximate); cve: equation solving; cv: discrete time (approximate)), normal adaptation, point set prediction)', choices = ['cvd', 'cve', 'cv', 'na', 'ps', 'mp'])
 parser.add_argument('--pet', dest = 'computePET', help = 'computes PET', action = 'store_true')
 parser.add_argument('--delete', dest = 'delete', help = 'data to delete', choices = ['feature', 'object', 'classification', 'interaction'])
 parser.add_argument('--process', dest = 'process', help = 'data to process', choices = ['feature', 'object', 'classification', 'interaction'])
@@ -40,7 +41,10 @@
 
 if args.process == 'interaction':
     # safety analysis TODO make function in safety analysis script
-    predictionParameters = prediction.CVDirectPredictionParameters()#prediction.CVExactPredictionParameters()
+    if args.predictionMethod == 'cvd':
+        predictionParameters = prediction.CVDirectPredictionParameters()
+    if args.predictionMethod == 'cve':
+        predictionParameters = prediction.CVExactPredictionParameters()
     for videoId in args.videoIds:
         vs = session.query(VideoSequence).get(videoId)
         print('Processing '+vs.getDatabaseFilename())