Skip to content

Commit

Permalink
small improvements to CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
ovs-code committed Oct 3, 2021
1 parent 80cb43a commit 1433527
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions application/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down

0 comments on commit 1433527

Please sign in to comment.