elif number_input_args > 1: exit_with_error( "Only one of input video, directory, or list should be specified, not more" ) if ( args.detection_plots or args.track_plots ) and len( args.frame_rate ) == 0: exit_with_error( "Must specify frame rate if generating detection or track plots" ) signal.signal( signal.SIGINT, signal_handler ) # Initialize database if args.init_db: if len( args.log_directory ) > 0: init_log_file = args.output_directory + div + args.log_directory + div + "database_log.txt" else: init_log_file = "" db_is_init, user_select = database_tool.init( log_file=init_log_file, prompt=(not args.no_reset_prompt) ) if not db_is_init: if user_select: log_info( "User decided to not initialize new database, shutting down." + lb2 ) sys.exit( 0 ) elif len( args.log_directory ) > 0: exit_with_error( "Unable to initialize database, check " + init_log_file + lb2 + "You may have another database running on your system, or ran " "a failed operation in the past and need to re-log or restart." ) else: exit_with_error( "Unable to initialize database" ) log_info( lb1 ) # Call processing pipelines on all input data if process_data:
) if (args.detection_plots or args.track_plots) and len( args.frame_rate) == 0: exit_with_error( "Must specify frame rate if generating detection or track plots") signal.signal(signal.SIGINT, signal_handler) # Initialize database if args.init_db: if len(args.log_directory) > 0: init_log_file = args.output_directory + div + args.log_directory + div + "database_log.txt" else: init_log_file = "" db_is_init, user_select = database_tool.init(log_file=init_log_file) if not db_is_init: if user_select: log_info( "User decided to not initialize new database, shutting down." + lb2) sys.exit(0) elif len(args.log_directory) > 0: exit_with_error( "Unable to initialize database, check " + init_log_file + lb2 + "You may have another database running on your system, or ran " "a failed operation in the past and need to re-log or restart." ) else: exit_with_error("Unable to initialize database")
if ( args.detection_plots or args.track_plots ) and len( args.frame_rate ) == 0: exit_with_error( "Must specify frame rate if generating detection or track plots" ) if args.pipeline == default_pipeline: args.init_db = True signal.signal( signal.SIGINT, signal_handler ) # Initialize database if args.init_db: if len( args.log_directory ) > 0: init_log_file = args.output_directory + div + args.log_directory + div + "database_log.txt" else: init_log_file = "" db_is_init, user_select = database_tool.init( log_file=init_log_file ) if not db_is_init: if user_select: log_info( "User decided to not initialize new database, shutting down." + lb2 ) sys.exit( 0 ) elif len( args.log_directory ) > 0: exit_with_error( "Unable to initialize database, check " + init_log_file + lb2 + "You may have another database running on your system, or ran " "a failed operation in the past and need to re-log or restart." ) else: exit_with_error( "Unable to initialize database" ) log_info( lb1 ) # Call processing pipelines on all input data if process_data:
if not args.build_index and not args.detection_plots: exit_with_error( "Either input video or input directory must be specified") else: process_data = False elif number_input_args > 1: exit_with_error( "Only one of input video, directory, or list should be specified, not more" ) signal.signal(signal.SIGINT, signal_handler) # Initialize database if args.init_db: database_tool.init() # Identify all videos to process video_list = [] if process_data: if len(args.input_list) > 0: video_list.append(args.input_list) is_image_list = True elif len(args.input_dir) > 0: video_list = list_files_in_dir(args.input_dir) is_image_list = False else: video_list.append(args.input_video) is_image_list = False
process_data = False elif number_input_args > 1: exit_with_error( "Only one of input video, directory, or list should be specified, not more" ) signal.signal(signal.SIGINT, signal_handler) # Initialize database if args.init_db: if len(args.log_directory) > 0: init_log_file = args.output_directory + div + args.log_directory + div + "database_log.txt" else: init_log_file = "" if not database_tool.init(log_file=init_log_file): exit_with_error("Unable to initialize database") # Call processing pipelines on all input data if process_data: # Identify all videos to process if len(args.input_list) > 0: video_list = split_image_list(args.input_list, args.gpu_count, args.output_directory) is_image_list = True elif len(args.input_dir) > 0: video_list = list_files_in_dir(args.input_dir) is_image_list = False else: video_list = [args.input_video]