From 1433527bd5a9c35814246206e7d568898118245c Mon Sep 17 00:00:00 2001 From: Oskar von Seeler Date: Mon, 4 Oct 2021 00:08:10 +0200 Subject: [PATCH] small improvements to CLI --- application/main.py | 6 +++--- run.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/application/main.py b/application/main.py index ffc0222..0fe9622 100644 --- a/application/main.py +++ b/application/main.py @@ -55,14 +55,14 @@ def stylize_video(input_path, output_path, fg_style, background:int, scaling, bg segmentation_model = SegmentationModel() height, width = get_video_resolution(input_path) - scaled_width = width // scaling - scaled_height = height // scaling + scaled_width = int(width // scaling) + scaled_height = int(height // scaling) input_controller = VideoFileInput(input_path, (scaled_width, scaled_height)) controller = Controller( style_models, segmentation_model, input_controller, output_path=output_path) updates = [ (Update.FG_STYLE, fg_style), - (Update.BG_STYLE, 'hundertwasser'), + (Update.BG_STYLE, bg_style), (Update.BACKGROUND, background), ] controller.start(OutputMode.VIDEO) diff --git a/run.py b/run.py index 9f0ec1c..447c42c 100644 --- a/run.py +++ b/run.py @@ -15,8 +15,8 @@ video_parser = subparsers.add_parser('video', help='Stylize a video file') video_parser.add_argument('--fg-style', help='style of the foreground', required=True) video_parser.add_argument('--bg-style', help='style of the background') - video_parser.add_argument('--background', help='mode of segmentation', choices=[0, 1, 2], default=0) - video_parser.add_argument('--scaling', help='downscale the video by a factor', type=int, default=1) + video_parser.add_argument('--background', help='mode of segmentation', type=int, default=0) + video_parser.add_argument('--scaling', help='downscale the video by a factor', type=float, default=1) video_parser.add_argument('infile', help='Video file to stylize') video_parser.add_argument('outfile', help='File to write result to')