|
76 | 76 | from matplotlib.widgets import Slider, Button |
77 | 77 | from matplotlib import patheffects |
78 | 78 |
|
79 | | -from rtmlib import PoseTracker, BodyWithFeet, Wholebody, Body, Custom |
| 79 | +from rtmlib import PoseTracker, BodyWithFeet, Wholebody, Body, Hand, Custom |
80 | 80 | from deep_sort_realtime.deepsort_tracker import DeepSort |
81 | 81 |
|
82 | 82 | from Sports2D.Utilities import filter |
@@ -1524,9 +1524,14 @@ def process_fun(config_dict, video_file, time_range, frame_rate, result_dir): |
1524 | 1524 | # Set up pose tracker |
1525 | 1525 | try: |
1526 | 1526 | pose_tracker = setup_pose_tracker(ModelClass, det_frequency, mode, False, backend, device) |
1527 | | - except: |
1528 | | - logging.error('Error: Pose estimation failed. Check in Config.toml that pose_model and mode are valid.') |
1529 | | - raise ValueError('Error: Pose estimation failed. Check in Config.toml that pose_model and mode are valid.') |
| 1527 | + except: # for multi-threading |
| 1528 | + try: |
| 1529 | + import time |
| 1530 | + time.sleep(3) |
| 1531 | + pose_tracker = setup_pose_tracker(ModelClass, det_frequency, mode, False, backend, device) |
| 1532 | + except: |
| 1533 | + logging.error('Error: Pose estimation failed. Check in Config.toml that pose_model and mode are valid.') |
| 1534 | + raise ValueError('Error: Pose estimation failed. Check in Config.toml that pose_model and mode are valid.') |
1530 | 1535 |
|
1531 | 1536 | if tracking_mode not in ['deepsort', 'sports2d']: |
1532 | 1537 | logging.warning(f"Tracking mode {tracking_mode} not recognized. Using sports2d method.") |
|
0 commit comments