Skip to content

Commit

Permalink
fixed time_range = [] in DEFAULT_CONFIG
Browse files Browse the repository at this point in the history
  • Loading branch information
davidpagnon committed Sep 6, 2024
1 parent 7689f5d commit adb5429
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Sports2D/Sports2D.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
- Run on webcam with default parameters:
sports2d --video_input webcam
- Run with custom parameters (all non specified are set to default):
sports2d --show_graphs False --time_range 0 2.1 --result_dir path_to_result_dir
sports2d --show_plots False --time_range 0 2.1 --result_dir path_to_result_dir
sports2d --multiperson false --mode lightweight --det_frequency 50
- Run with a toml configuration file:
sports2d --config path_to_config.toml
Expand Down Expand Up @@ -123,7 +123,7 @@

## CONSTANTS
DEFAULT_CONFIG = {'project': {'video_input': ['demo.mp4'],
'time_range': [0, sys.maxsize],
'time_range': [],
'video_dir': '',
'webcam_id': 0,
'input_size': [1280, 720]
Expand Down Expand Up @@ -408,7 +408,7 @@ def main():
- Run on webcam with default parameters:
sports2d --video_input webcam
- Run with custom parameters (all non specified are set to default):
sports2d --show_graphs False --time_range 0 2.1 --result_dir path_to_result_dir
sports2d --show_plots False --time_range 0 2.1 --result_dir path_to_result_dir
sports2d --multiperson false --mode lightweight --det_frequency 50
- Run with a toml configuration file:
sports2d --config path_to_config.toml
Expand All @@ -425,7 +425,7 @@ def main():
arg_str = [f'-{short_key}', f'--{leaf_name}'] if short_key else [f'--{leaf_name}']
if type(leaf_keys[leaf_name]) == bool:
parser.add_argument(*arg_str, type=str2bool, help=CONFIG_HELP[leaf_name][1])
elif type(leaf_keys[leaf_name]) == list:
elif type(leaf_keys[leaf_name]) == list and len(leaf_keys[leaf_name])>0:
parser.add_argument(*arg_str, type=type(leaf_keys[leaf_name][0]), nargs='*', help=CONFIG_HELP[leaf_name][1])
else:
parser.add_argument(*arg_str, type=type(leaf_keys[leaf_name]), help=CONFIG_HELP[leaf_name][1])
Expand Down

0 comments on commit adb5429

Please sign in to comment.