* Don't return weighted name if it has the same number of results

* Remove link to incorrect format yolov9 models

* Fix command list from appearing when other inputs are focused

the description box in the tracked object details pane was causing the command input list to show when focused.

* clarify face docs

* Add note about python yolov9 export

* Check if hailort thread is still alive when timeout error is run into

* Reduce inference timeout

---------

Co-authored-by: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com>
This commit is contained in:
Nicolas Mowen
2025-05-27 09:25:34 -06:00
committed by GitHub
parent 63f9689b0e
commit cbdac9ece5
5 changed files with 36 additions and 8 deletions

View File

@@ -471,17 +471,22 @@ class FaceRealTimeProcessor(RealTimeProcessorApi):
if not results_list:
return None, 0.0
weighted_scores = {}
total_weights = {}
counts: dict[str, int] = {}
weighted_scores: dict[str, int] = {}
total_weights: dict[str, int] = {}
for name, score, face_area in results_list:
if name == "unknown":
continue
if name not in weighted_scores:
counts[name] = 0
weighted_scores[name] = 0.0
total_weights[name] = 0.0
# increase count
counts[name] += 1
# Capped weight based on face area
weight = min(face_area, max_weight)
@@ -494,6 +499,12 @@ class FaceRealTimeProcessor(RealTimeProcessorApi):
return None, 0.0
best_name = max(weighted_scores, key=weighted_scores.get)
# If the best name has the same number of results as another name, we are not confident it is a correct result
for name, count in counts.items():
if name != best_name and counts[best_name] == count:
return None, 0.0
weighted_average = weighted_scores[best_name] / total_weights[best_name]
return best_name, weighted_average