cleaned up code.

This commit is contained in:
didier committed 2024-11-08 11:57:32 -05:00
1 parent afbe73cd21
commit 4171dd2bc4
4 files changed
+51 -45

No files matched your search

+10 -6
View File
@@ -41,12 +41,7 @@ def get_video_writer(display_frame: bool,
return closing(MP4VVideoWriter.from_frame(video_input, video_output, thresholds))
@cli.command()
@click.option('--input', '-i', 'input_',
type=click.Path(readable=True, path_type=Path))
@click.option('--output', '-o', type=click.Path(path_type=Path))
@click.option('--display-video', '-d', type=bool, is_flag=True, show_default=True, default=False)
def process(input_: Path, output: Path | None, display_video: bool):
def process_logic(input_: Path, output: Path | None, display_video: bool):
output = get_output(input_, output)
detected_box_objects = [
DetectedObjectBox.from_viridis(threshold) for threshold in
@@ -65,6 +60,15 @@ def process(input_: Path, output: Path | None, display_video: bool):
with time_tracker():
tracker.main()
@cli.command()
@click.option('--input', '-i', 'input_',
type=click.Path(readable=True, path_type=Path))
@click.option('--output', '-o', type=click.Path(path_type=Path))
@click.option('--display-video', '-d', type=bool, is_flag=True, show_default=True, default=False)
def process(input_: Path, output: Path | None, display_video: bool):
process_logic(input_, output, display_video)
if __name__ == "__main__":
cli()
# process_logic(Path('/home/didier/all-dressed-programming/dodgeball-tracker/data/micro.mp4'), None, False)