if args.gpu_count > 1: # Each thread outputs 1 list, add multiple add_final_list_csv( args, video_list ) for image_list in video_list: # Clean up after split_image_list os.unlink( image_list ) if not video_queue.empty(): exit_with_error( "Some videos were not processed!" ) # Build out detection vs time plots for both detections and tracks if args.detection_plots: import generate_detection_plots log_info( lb1 + "Generating data plots for detections" ) detection_plot_dir = os.path.join( args.output_directory, "detection_plots" ) create_dir( detection_plot_dir, logging=False, recreate=True, prompt=False ) generate_detection_plots.detection_plot( args.output_directory, detection_plot_dir, args.objects.split( "," ), float( args.plot_threshold ), float( args.frame_rate ), int( args.smooth ), ext = detection_ext, top_category_only = False ) if args.track_plots: import generate_detection_plots log_info( lb1 + "Generating data plots for tracks" ) track_plot_dir = os.path.join( args.output_directory, "track_plots" ) create_dir( track_plot_dir, logging=False, recreate=True, prompt=False ) generate_detection_plots.detection_plot( args.output_directory, track_plot_dir, args.objects.split( "," ), float( args.plot_threshold ), float( args.frame_rate ), int( args.smooth ), ext = track_ext, top_category_only = True ) if args.detection_plots or args.track_plots: log_info( lb1 )
if is_image_list: for image_list in video_list: # Clean up after split_image_list os.unlink( image_list ) if not video_queue.empty(): exit_with_error( "Some videos were not processed!" ) # Build out detection vs time plots for both detections and tracks if args.detection_plots: import generate_detection_plots log_info( lb1 + "Generating data plots for detections" ) detection_plot_dir = args.plot_dir_prefix + "_detections" create_dir( detection_plot_dir, logging=False, recreate=True, prompt=False ) generate_detection_plots.detection_plot( args.output_directory, detection_plot_dir, args.objects.split( "," ), float( args.plot_threshold ), float( args.frame_rate ), int( args.smooth ), ext = detection_ext, top_category_only = False ) if args.track_plots: import generate_detection_plots log_info( lb1 + "Generating data plots for tracks" ) track_plot_dir = args.plot_dir_prefix + "_tracks" create_dir( track_plot_dir, logging=False, recreate=True, prompt=False ) generate_detection_plots.detection_plot( args.output_directory, track_plot_dir, args.objects.split( "," ), float( args.plot_threshold ), float( args.frame_rate ), int( args.smooth ), ext = track_ext, top_category_only = True ) if args.detection_plots or args.track_plots: log_info( lb1 )