From e3108bb212f1697a7bac575ddaf97d2b092ac62c Mon Sep 17 00:00:00 2001 From: Laizo Date: Thu, 24 Oct 2024 10:34:59 +0200 Subject: [PATCH] renamed multiperson parameter --- README.md | 4 ++-- Sports2D/Demo/Config_demo.toml | 2 +- Sports2D/Sports2D.py | 10 +++++----- Sports2D/process.py | 10 +++++----- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 684ccdf..f2e7231 100644 --- a/README.md +++ b/README.md @@ -147,7 +147,7 @@ sports2d --help sports2d --show_graphs False --time_range 0 2.1 --result_dir path_to_result_dir ``` ``` cmd - sports2d --multiperson false --mode lightweight --det_frequency 50 + sports2d --multi_person false --mode lightweight --det_frequency 50 ``` - Run with a toml configuration file: ``` cmd @@ -165,7 +165,7 @@ sports2d --help ### Too slow for you? **Quick fixes:** -- Use `--multiperson false`: Can be used if one single person is present in the video. Otherwise, persons' IDs may be mixed up. +- Use `--multi_person false`: Can be used if one single person is present in the video. Otherwise, persons' IDs may be mixed up. - Use `--mode lightweight`: Will use a lighter version of RTMPose, which is faster but less accurate. - Use `--det_frequency 50`: Will detect poses only every 50 frames, and track keypoints inbetween, which is faster. diff --git a/Sports2D/Demo/Config_demo.toml b/Sports2D/Demo/Config_demo.toml index 836943b..175faab 100644 --- a/Sports2D/Demo/Config_demo.toml +++ b/Sports2D/Demo/Config_demo.toml @@ -27,7 +27,7 @@ input_size = [1280, 720] # [W, H]. Lower resolution will be faster but less prec [process] -multiperson = true # Multiperson involves tracking: will be faster if false +multi_person = true # Multi-person involves tracking: will be faster if false show_realtime_results = true save_vid = true save_img = true diff --git a/Sports2D/Sports2D.py b/Sports2D/Sports2D.py index 91e4ca1..91d6504 100644 --- a/Sports2D/Sports2D.py +++ b/Sports2D/Sports2D.py @@ -29,7 +29,7 @@ sports2d --video_input webcam - Run with custom parameters (all non specified are set to default): sports2d --show_plots False --time_range 0 2.1 --result_dir path_to_result_dir - sports2d --multiperson false --mode lightweight --det_frequency 50 + sports2d --multi_person false --mode lightweight --det_frequency 50 - Run with a toml configuration file: sports2d --config path_to_config.toml @@ -129,7 +129,7 @@ 'webcam_id': 0, 'input_size': [1280, 720] }, - 'process': {'multiperson': True, + 'process': {'multi_person': True, 'show_realtime_results': True, 'save_vid': True, 'save_img': True, @@ -206,7 +206,7 @@ 'mode': ["m", "light, balanced, or performance. balanced if not specified"], 'det_frequency': ["f", "Run person detection only every N frames, and inbetween track previously detected bounding boxes. keypoint detection is still run on all frames.\n\ Equal to or greater than 1, can be as high as you want in simple uncrowded cases. Much faster, but might be less accurate. 1 if not specified: detection runs on all frames"], - 'multiperson': ["M", "Multiperson involves tracking: will be faster if set to false. true if not specified"], + 'multi_person': ["M", "Multi-person involves tracking: will be faster if set to false. true if not specified"], 'tracking_mode': ["", "sports2d or rtmlib. sports2d is generally much more accurate and comparable in speed. sports2d if not specified"], 'input_size': ["", "width, height. 1280, 720 if not specified. Lower resolution will be faster but less precise"], 'keypoint_likelihood_threshold': ["", "Detected keypoints are not retained if likelihood is below this threshold. 0.3 if not specified"], @@ -327,7 +327,7 @@ def get_leaf_keys(config, prefix=''): def update_nested_dict(config, key_path, value): ''' - Update a nested dictionary based on a key path string like 'process.multiperson'. + Update a nested dictionary based on a key path string like 'process.multi_person'. ''' keys = key_path.split('.') @@ -435,7 +435,7 @@ def main(): sports2d --video_input webcam - Run with custom parameters (all non specified are set to default): sports2d --show_plots False --time_range 0 2.1 --result_dir path_to_result_dir - sports2d --multiperson false --mode lightweight --det_frequency 50 + sports2d --multi_person false --mode lightweight --det_frequency 50 - Run with a toml configuration file: sports2d --config path_to_config.toml ''' diff --git a/Sports2D/process.py b/Sports2D/process.py index d3e08ba..2cb40f3 100644 --- a/Sports2D/process.py +++ b/Sports2D/process.py @@ -1032,7 +1032,7 @@ def process_fun(config_dict, video_file, frame_range, frame_rate, result_dir): input_size = config_dict.get('project').get('input_size') # Process settings - tracking = config_dict.get('process').get('multiperson') + multi_person = config_dict.get('process').get('multi_person') show_realtime_results = config_dict.get('process').get('show_realtime_results') save_vid = config_dict.get('process').get('save_vid') save_img = config_dict.get('process').get('save_img') @@ -1123,11 +1123,11 @@ def process_fun(config_dict, video_file, frame_range, frame_rate, result_dir): # Set up pose tracker - tracking_rtmlib = True if (tracking_mode == 'rtmlib' and tracking) else False + tracking_rtmlib = True if (tracking_mode == 'rtmlib' and multi_person) else False pose_tracker = setup_pose_tracker(det_frequency, mode, tracking_rtmlib) logging.info(f'Pose tracking set up for BodyWithFeet model in {mode} mode.') - logging.info(f'Persons are detected every {det_frequency} frames and tracked inbetween. Multi-person is {"" if tracking else "not "}selected.') - logging.info(f"Parameters: {f'{tracking_mode=}, ' if tracking else ''}{keypoint_likelihood_threshold=}, {average_likelihood_threshold=}, {keypoint_number_threshold=}") + logging.info(f'Persons are detected every {det_frequency} frames and tracked inbetween. Multi-person is {"" if multi_person else "not "}selected.') + logging.info(f"Parameters: {f'{tracking_mode=}, ' if multi_person else ''}{keypoint_likelihood_threshold=}, {average_likelihood_threshold=}, {keypoint_number_threshold=}") # Process video or webcam feed @@ -1164,7 +1164,7 @@ def process_fun(config_dict, video_file, frame_range, frame_rate, result_dir): keypoints, scores = pose_tracker(frame) # Track persons - if tracking: # multi-person + if multi_person: if tracking_rtmlib: keypoints, scores = sort_people_rtmlib(pose_tracker, keypoints, scores) else: