예제 #1
0
def upload_video():
    if request.method == 'POST':
        file_name = get_file_path_and_save(request)
        detection = DetectionValue()
        detection.set_display(0)
        detection.set_output(1)
        detection.set_input_videos('uploads/video.mp4')
        detection.set_output_path("outputs/video.mp4")
        video(detection)
        return file_name
    return None
예제 #2
0
                    type=int,
                    default=2,
                    help='Number of workers.')
    ap.add_argument('-q-size',
                    '--queue-size',
                    dest='queue_size',
                    type=int,
                    default=5,
                    help='Size of the queue.')
    ap.add_argument('-l',
                    '--logger-debug',
                    dest='logger_debug',
                    type=int,
                    default=0,
                    help='Print logger debug')
    ap.add_argument('-f',
                    '--fullscreen',
                    dest='full_screen',
                    type=int,
                    default=0,
                    help='enable full screen')
    args = vars(ap.parse_args())

    # Use realtime function if no video has been provided
    if args['input_videos'] == "":
        realtime(args)

    # Use video function else
    else:
        video(args)
    
    # construct the argument parse and parse the arguments
    ap = argparse.ArgumentParser()
    ap.add_argument("-n", "--num-frames", type=int, default=0,
	            help="# of frames to loop over for FPS test")
    ap.add_argument("-d", "--display", type=int, default=0,
	            help="Whether or not frames should be displayed")
    ap.add_argument("-o", "--output", type=int, default=0,
	            help="Whether or not modified videos shall be writen")
    ap.add_argument("-on", "--output-name", type=str, default="output",
	            help="Name of the output video file")
    ap.add_argument("-I", "--input-device", type=int, default=0,
	            help="Device number input")
    ap.add_argument("-i", "--input-videos", type=str, default="",
	            help="Path to videos input, overwrite device input if used")
    ap.add_argument('-w', '--num-workers', dest='num_workers', type=int,
                        default=2, help='Number of workers.')
    ap.add_argument('-q-size', '--queue-size', dest='queue_size', type=int,
                        default=5, help='Size of the queue.')
    ap.add_argument('-l', '--logger-debug', dest='logger_debug', type=int,
                        default=0, help='Print logger debug')
    args = vars(ap.parse_args())

    # Use realtime function if no video has been provided
    if args['input_videos'] == "":
        realtime(args)

    # Use video function else
    else:
        video(args)