Skip to content

Commit 768652c

Browse files
committed
add min score
1 parent 4e4d983 commit 768652c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tools/tracking/convert_pose_to_tracking.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def get_dummy_detection(keypoints, scores, bbox_ltwh):
119119
}
120120

121121

122-
def convert_tracking(data_dir, out_dir, keypoint_file):
122+
def convert_tracking(data_dir, out_dir, keypoint_file, min_score=0.4):
123123
image_root = os.path.join(data_dir, 'frames')
124124
with open(keypoint_file, 'r') as f:
125125
pose_data = json.load(f)
@@ -161,6 +161,8 @@ def convert_tracking(data_dir, out_dir, keypoint_file):
161161
keypoints_2d = keypoint[:, 0:2]
162162
scores = keypoint[:, 2]
163163
person = get_dummy_detection(keypoints_2d, scores, tlwh)
164+
if person['score'] < min_score:
165+
continue
164166
file_data['people'].append(person)
165167

166168
if not os.path.exists(os.path.dirname(output_file)):

0 commit comments

Comments
 (0)