Classes | Functions
include.config Namespace Reference


class  AggMethod
class  AggMethods
class  Back
class  Config
 Configuration. More...
class  ConfigValue
class  Fore
class  InteractionClassificationMethod
class  InteractionClassificationMethods
class  NullWriter
class  PredictionMethod
class  PredictionMethods
 Interaction configruation. More...
class  PredictionParams
class  Style


def commands ()

Function Documentation

◆ commands()

def include.config.commands ( )

Definition at line 247 of file

247 def commands():
248  parser = ArgumentParser()
251  parser.add_argument('opt1', nargs='?')
252  parser.add_argument('opt2', nargs='?')
253  parser.add_argument('opt3', nargs='?')
256  parser.add_argument( '--concat', action='store_true', dest='concat', default=False, help='[bool] Run batch analysis on all sequences only (does not pre-treat sequences individually; assumes already pre-treated)')
257  parser.add_argument( '--skip-concat', action='store_true', dest='skip_concat', default=False, help='[bool] If concat is set to False, setting this to true will force concat mode to be skipped completly)')
258  parser.add_argument( '--multicore', action='store_true', dest='multicore', default=False, help='[bool] If set to true, and running multiple threads, a single child process will be spawned but this child will consume all normally available threads.')
259  parser.add_argument( '--configreadonly', action='store_true', dest='configreadonly', default=False, help='[bool] If set to true, configuration file will be be run in read-only mode (this corrects an issue with multiprocessing race conditions).')
260  parser.add_argument( '--oneseqpersite', action='store_true', dest='oneseqpersite', default=False, help='[bool] If set to true, only one sequence will be processed per site or site-analysis.')
263  parser.add_argument( '--cluster', type=str, dest='cluster', default='', help='[str] (A) Specify cluster of analyses by name. An empty string will process all clusters.')
264  parser.add_argument( '--export-csv', action='store_true', dest='export_csv', default=False, help='[bool] (A) Dump data to csv files.')
265  parser.add_argument( '--depth', type=int, dest='depth', default=2, help='[int] (A) Specify depth of analysis.')
268  parser.add_argument( '--create-camtype', action='store_true', dest='create_camtype', default=False, help='[bool] Create metadata element: camera type')
269  parser.add_argument( '--create-site', action='store_true', dest='create_site', default=False, help='[bool] Create metadata element: site')
270  parser.add_argument( '--create-view', action='store_true', dest='create_view', default=False, help='[bool] Create metadata element: camera view')
271  parser.add_argument( '--create-seqs', action='store_true', dest='create_seqs', default=False, help='[bool] Create metadata elements: sequences')
272  parser.add_argument( '--create-sa', action='store_true', dest='create_sa', default=False, help='[bool] Create metadata element: site-analysis')
273  parser.add_argument( '--create-analysis', action='store_true', dest='create_analysis', default=False, help='[bool] Create metadata element: analysis')
276  parser.add_argument( '--undistort', action='store_true', dest='undistort', default=False, help='[bool] Run undistortion functions')
277  parser.add_argument( '--framedump', action='store_true', dest='framedump', default=False, help='[bool] Force a frame dump of the selected sequence')
278  parser.add_argument( '--train-class', action='store_true', dest='train_classifier', default=False, help='[bool] Train classification algorythm')
279  parser.add_argument( '--test-class', action='store_true', dest='test_classifier', default=False, help='[bool] Test the trained classification algorythm')
280  parser.add_argument( '--extract-images', action='store_true', dest='extract_images', default=False, help='[bool] Use this option to extract images from selected sites')
281  parser.add_argument( '--homo', type=int, dest='homo', default=0, help='[int] Run homography functions with this many points')
282  parser.add_argument( '--homosatsrc', type=str, dest='homo_sat_src', default='', help='[str] Force loading a specific satellite image file by filename')
283  parser.add_argument( '--test-track', action='store_true', dest='test_track', default=False, help='[bool] Run tracking sequence test. Combine with -r for visual inspection.')
284  parser.add_argument( '--test-track-params', type=str, dest='test_track_param_filename', default='', help='[str] Path to file with tracking parameters to test. File should be a csv, one colum per param, with first line being the param name, and each subsequent line being one tast case.')
285  parser.add_argument( '--trafint', action='store_true', dest='trafint', default=False, help='[bool] Run trajectory extraction functions')
286  parser.add_argument( '--mota-opt-t', action='store_true', dest='mota_opt_t', default=False, help='[bool] Attempt an MOT optimisation (tracking and grouping parameters)')
287  parser.add_argument( '--mota-opt-g', action='store_true', dest='mota_opt_g', default=False, help='[bool] Attempt an MOT optimisation (grouping parameters)')
288  parser.add_argument( '--mota-opt-f', action='store_true', dest='mota_opt_f', default=False, help='[bool] Attempt an MOT optimisation (filtering parameters)')
289  parser.add_argument( '--del-tva', action='store_true', dest='detroy_tva_data', default=False, help='[bool] This destroys related saved tvaLib data (ALL data including, serialisation, events, results, figures), except for analysis output')
290  parser.add_argument( '--del-tva-traj', action='store_true', dest='detroy_tva_data_ser_traj', default=False, help='[bool] This destroys related saved tvaLib data (serialisation only)')
291  parser.add_argument( '--del-tidata', action='store_true', dest='detroy_ti_data', default=False, help='[bool] This destroys related TI tracking data')
292  parser.add_argument( '--del-fig-by-type', type=str, dest='detroy_figures_by_type', default='', help='[str] Flushes any saved figures of this specific type (by file extension)')
293  parser.add_argument( '--disk-space-usage', action='store_true', dest='disk_space_usage', default=False, help='[bool] Calculate disk space usage')
294  parser.add_argument( '--rfs', action='store_true', dest='rebuild_file_structure', default=False, help='[bool] Rebuild file structure (from root directory)')
295  parser.add_argument( '--rfs-from-disk', type=str, dest='rfs_from_disk', default='', help='[bool] Rebuild file structure (from root directory) copying metadata files from a source location')
298  parser.add_argument('-z', '--dir', type=str, dest='dir', default='', help='[str] Directory containing a specific database (overrides config)')
299  parser.add_argument('-d', '--dbn', type=str, dest='dbn', default='', help='[str] Load a specific database (overrides config)')
300  parser.add_argument( '--analysis', type=str, dest='analysis', default='', help='[str] Load specific analysis case')
301  parser.add_argument('-b', '--s-analysis', type=str, dest='s_analysis', default='', help='[str] Load specific site analysis case')
302  parser.add_argument('-s', '--site', type=str, dest='site', default='', help='[str] Load specific site')
303  parser.add_argument('-c', '--camera', type=str, dest='camera', default='', help='[str] Load specific camera')
304  parser.add_argument('-f', '--file', type=str, dest='file', default='', help='[str] Load specific sequence')
305  parser.add_argument( '--filename-override', type=str, dest='filename_override', default='', help='[str] Temporarily force a sequence to use this specific tracking file instead')
306  parser.add_argument('-k', '--no-track-filt', action='store_true', dest='no_track_filt', default=False, help='[bool] Disable filtering functions correcting tracking errors.')
307  parser.add_argument( '--force-reclassify', action='store_true', dest='force_reclassify', default=False, help='[bool] Force relcassification of tracked objects.')
308  parser.add_argument( '--commit-classify', action='store_true', dest='commit_classify', default=False, help='[bool] Commit classifications back to SQLite file for future use.')
309  parser.add_argument( '--no-filt', action='store_true', dest='no_filt', default=False, help='[bool] Disable ALL filtering functions (advanced usage only)')
310  parser.add_argument( '--proc-gt', action='store_true', dest='proc_gt', default=False, help='[bool] Process ground truth trajectories if available. Filters will be disabled.')
311  parser.add_argument( '--rej-s', type=str, dest='rej_site', default='', help='[str] Reject specific sites')
312  parser.add_argument( '--rej-c', type=str, dest='rej_cam', default='', help='[str] Reject specific camera')
313  parser.add_argument('-p', '--play', action='store_true', dest='play', default=False, help='[bool] Launch interactive object inspector or playback video during TI operations')
314  parser.add_argument( '--play-vid', action='store_true', dest='play_vid', default=False, help='[bool] Launch interactive video playback.')
315  parser.add_argument( '--play-filt', type=str, dest='play_filt', default='', help='[str] Launch interactive filtered object inspector, by designated type, e.g.: ie, bb, so, te, td, tc')
316  parser.add_argument( '--play-inf', action='store_true', dest='play_inf', default=False, help='[bool] Play video of infractions')
317  parser.add_argument( '--play-int', action='store_true', dest='play_int', default=False, help='[bool] Launch interactive interaction inspector')
318  parser.add_argument( '--annotate', action='store_true', dest='annotate', default=False, help='[bool] Launch interactive annotation tool.')
319  parser.add_argument('-w', '--fig', action='store_true', dest='fig_save', default=False, help='[bool] Generate figures')
320  parser.add_argument( '--fig-advanced', action='store_true', dest='fig_save_advanced', default=False, help='[bool] Generate advanced figures. These are very slow to generate or are experimental.')
321  parser.add_argument( '--figure-save-lan-a', action='store_true', dest='fig_save_lan_a', default=False, help='[bool] When saving figures, append language as suffix')
322  parser.add_argument( '--figure-format', type=str, dest='fig_format', default='png', help='[str] Force saving images to a particular format. Enter a supported extensions (e.g. png, svg, pdf). Default is .png')
323  parser.add_argument( '--figure-resize', type=float, dest='fig_resize', nargs=2, default=None, help='[float]Force figure resize upon saving, in inches. Format is newX.float newY.float. Print freindly size: "10 7". Default is set in config.')
324  parser.add_argument( '--figure-style', type=str, dest='fig_style', default='', help='[str] Load a matplotlib style by name. recommend "bmh". See plotSettings() for more info')
325  parser.add_argument('-a', '--save-data', action='store_true', dest='save_data', default=False, help='[bool] Saves raw operational data')
326  parser.add_argument( '--save-data-light', action='store_true', dest='save_data_light', default=False, help='[bool] Saves only essential raw operational data')
327  parser.add_argument('-x', '--export', action='store_true', dest='export_traj', default=False, help='[bool] Export trajectories')
328  parser.add_argument('-u', '--flush', action='store_true', dest='save_data_flush', default=False, help='[bool] Flushes any saved data')
329  parser.add_argument( '--flush-objects', action='store_true', dest='save_data_flush_objects', default=False, help='[bool] Flushes any saved objects only')
330  parser.add_argument( '--flush-indicators', action='store_true', dest='save_data_flush_indicators', default=False, help='[bool] Flushes any saved indicators only')
331  parser.add_argument( '--flush-dmp', action='store_true', dest='save_data_flush_dmp', default=False, help='[bool] Flushes any saved DMP data')
332  parser.add_argument( '--gen-dmp', action='store_true', dest='save_data_gen_dmp', default=False, help='[bool] In this mode, only DMP data will be generated, interactions will be skipped')
333  parser.add_argument( '--plot-dmp', action='store_true', dest='plot_dmp', default=False, help='[bool] Produce sample DMP plot')
334  parser.add_argument('-q', '--statistics', action='store_true', dest='stat', default=False, help='[bool] Dump statistics')
335  parser.add_argument( '--sample-traj', type=str, dest='sample_traj', default='', help='[str(int,list)] Declare to plot individual trajectory points (pre-filter)')
336  parser.add_argument('-r', '--draw', action='store_true', dest='draw', default=False, help='[bool] Run in basic draw mode')
337  parser.add_argument( '--draw-align', action='store_true', dest='draw_align', default=False, help='[bool] Run in draw mode (alignments)')
338  parser.add_argument( '--draw-align-no-trk', action='store_true', dest='draw_align_no_trk', default=False, help='[bool] Run in draw mode (alignments; without loading trajectories)')
339  parser.add_argument( '--draw-mask', action='store_true', dest='draw_mask', default=False, help='[bool] Run in draw mode (image mask)')
340  parser.add_argument( '--draw-mask2', action='store_true', dest='draw_mask2', default=False, help='[bool] Run in draw mode (image mask, option/view 2)')
341  parser.add_argument( '--draw-zone', action='store_true', dest='draw_zone', default=False, help='[bool] Run in draw mode (analysis zone)')
342  parser.add_argument( '--draw-loops', action='store_true', dest='draw_loops', default=False, help='[bool] Run in draw mode (loop detectors)')
343  parser.add_argument( '--draw-transform', action='store_true', dest='draw_transform', default=False, help='[bool] Run in draw mode (transform coordinates)')
344  parser.add_argument( '--draw-mhc', action='store_true', dest='mast_height_calibration', default=False, help='[bool] Run in draw mode (mast height calibration)')
345  parser.add_argument( '--draw-ml', action='store_true', dest='draw_mast_location', default=False, help='[bool] Run in draw mode (mast location)')
346  parser.add_argument( '--draw-hli', action='store_true', dest='draw_hli', default=False, help='[bool] If running an HLI module, special drawing console will be run')
347  parser.add_argument( '--draw-bounds', action='store_true', dest='draw_bounds', default=False, help='[bool] Run in draw mode (plotting bounds)')
348  parser.add_argument( '--auto-bounds', action='store_true', dest='auto_bounds', default=False, help='[bool] Automatically create bounds for sites missing bounds.')
349  parser.add_argument('-g', '--snap-align', action='store_true', dest='snap_align', default=False, help='[bool] Choose points to get alignment information')
350  parser.add_argument('-j', '--obj-highlight', action='store_true', dest='obj_highlight', default=False, help='[bool] Highlight specific object trajectories (interactively)')
351  parser.add_argument('-o', '--objects', type=int, dest='max_obj', default=-1, help='[int] Load a desired number of objects (-1 for all)')
352  parser.add_argument( '--start-time', type=int, dest='start_time', default=0, help='[int] Start at a desired time (in seconds)')
353  parser.add_argument( '--time', type=int, dest='time', default=0, help='[int] Load a desired duration of time (in seconds, 0 for all)')
354  parser.add_argument('-t', '--threads', type=int, dest='threads', default=1, help='[int] Multi-core where possible with this many threads')
355  parser.add_argument('-i', '--indicators', type=str, dest='indicators', default='', help='[str(int,list)] 1D list of PredictionParameters to use; default = [0]; or turn off conflict analysis with -i []')
356  parser.add_argument( '--concat-data', action='store_true', dest='concat_mode', default=False, help='[bool] This mode wil concatenate result chunks into one result')
357  parser.add_argument('-l', '--log', action='store_true', dest='logging', default=False, help='[bool] Dump output to log.')
358  parser.add_argument('-v', '--verbose', type=int, dest='verbose', default=1, help='[int] Level of detail of results')
359  parser.add_argument( '--suppress-features', action='store_true', dest='suppress_features', default=False, help='[bool] Use this to suppress loading of features (not recommended for inexperienced users)')
360  parser.add_argument( '--mem-clean-feature', action='store_true', dest='memory_clean_feature', default=False, help='[bool] Purge features as soon as possible to save memory (recommended to use if running into memory issues with particularly large trajectory data sets)')
361  parser.add_argument( '--stitch', action='store_true', dest='stitch', default=False, help='[bool] Enable trajectory stitching between multiple cameras (currently unsupported)')
362  parser.add_argument('-e', '--interactive', action='store_true', dest='interactive', default=False, help='[bool] Toggle interactive selection mode')
363  parser.add_argument( '--interactive-opt', action='store_true', dest='interactive_opt', default=False, help='[bool] Toggle interactive commands')
364  parser.add_argument('-y', '--hli', type=str, dest='hli', default='', help='[str] Load high-level analysis module of this name')
365  parser.add_argument( '--hli-only', action='store_true', dest='hli_only', default=False, help='[bool] Skip normal analysis and process HLI only')
366  parser.add_argument( '--hli-report', action='store_true', dest='hli_report', default=False, help='[bool] Generate an automated report using an HLI extension if available. Check the extension\'s documentation to see if it expects additional/specific commands to be used for proper formatting')
367  parser.add_argument('-m', '--mot', action='store_true', dest='mot', default=False, help='[bool] Perform MOT (external dependency) ground truth analysis on objects after filtering')
368  parser.add_argument('-n', '--lan', type=str, dest='language', default='', help='[str] Specify output language (defaults to that specified in config file)')
369  parser.add_argument( '--legacy', action='store_true', dest='legacy', default=False, help='[bool] This command can be used to force legacy modes (for advanced users only)')
370  parser.add_argument( '--timeseries', type=int, dest='timeseries', nargs=2, default=False, help='[int] Enable timeseries analysis between these two objects')
371  parser.add_argument( '--infractions', action='store_true', dest='infractions', default=False, help='[bool] Enable infraction detection (experimental)')
372  parser.add_argument( '--max-ucon-obj', type=int, dest='max_ucon_obj', default=150, help='[int] Maximum number of unconstrained objects to store in memory automatically for plotting purposes (set to 0 to save memory.)')
375  commands = parser.parse_args()
378  if(commands.interactive_opt):
379  inp = raw_input('Interactive command mode elected. Enter some command line arguments\nnow to override defaults: ')
380  import shlex
381  try: commands = parser.parse_args(shlex.split(inp))
382  except: print 'Warning: Commands failed. Ignoring user input.'
385  if( or
386  commands.play_vid or
387  commands.play_filt or
388  commands.play_inf or
389  commands.play_int or
390  commands.annotate): commands.f_tk_interface = True
391  else: commands.f_tk_interface = False
392  if(commands.draw):
393  commands.draw_mask = True
394  commands.draw_align = True
395  commands.draw_zone = True
396  commands.draw_bounds = True
397  if(commands.homo or
398  commands.test_track or
399  commands.draw_align or
400  commands.draw_align_no_trk or
401  commands.draw_mask or
402  commands.draw_zone or
403  commands.draw_loops or
404  commands.draw_transform or
405  commands.draw_bounds or
406  commands.snap_align or
407  commands.obj_highlight or
408  commands.draw_hli or
409  commands.mast_height_calibration): commands.f_interface = True
410  else: commands.f_interface = False
411  if(commands.save_data_gen_dmp or
412  commands.plot_dmp or
413  commands.indicators):
414  commands.max_ucon_obj = None
415  commands.memory_clean_feature = True
427  return commands
def commands()