Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f9a6dad

Browse files
Adds tracking score visualization if its posible
1 parent d46dcd5 commit f9a6dad

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

‎performance_comparison_sample.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,11 @@ def main():
170170
# 追跡アップデート
171171
start_time = time.time()
172172
ok, bbox = tracker.update(image)
173+
try:
174+
tracker_score = tracker.getTrackingScore()
175+
except:
176+
tracker_score = '-'
177+
173178
elapsed_time_list.append(time.time() - start_time)
174179
if ok:
175180
# 追跡後のバウンディングボックス描画
@@ -185,11 +190,18 @@ def main():
185190

186191
# 各アルゴリズム処理時間描画
187192
for index, tracker_algorithm in enumerate(tracker_algorithm_list):
188-
cv.putText(
189-
debug_image, tracker_algorithm + " : " +
190-
'{:.1f}'.format(elapsed_time_list[index] * 1000) + "ms",
191-
(10, int(25 * (index + 1))), cv.FONT_HERSHEY_SIMPLEX, 0.7,
192-
color_list[index], 2, cv.LINE_AA)
193+
if tracker_score != '-':
194+
cv.putText(
195+
debug_image, tracker_algorithm + " : " +
196+
'{:.1f}'.format(elapsed_time_list[index] * 1000) + "ms" + ' Score:{:.2f}'.format(tracker_score),
197+
(10, int(25 * (index + 1))), cv.FONT_HERSHEY_SIMPLEX, 0.7,
198+
color_list[index], 2, cv.LINE_AA)
199+
else:
200+
cv.putText(
201+
debug_image, tracker_algorithm + " : " +
202+
'{:.1f}'.format(elapsed_time_list[index] * 1000) + "ms",
203+
(10, int(25 * (index + 1))), cv.FONT_HERSHEY_SIMPLEX, 0.7,
204+
color_list[index], 2, cv.LINE_AA)
193205

194206
cv.imshow(window_name, debug_image)
195207

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /