Skip to content

Commit

Permalink
centroid_socre_threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
PINTO0309 committed Dec 16, 2024
1 parent d863f67 commit 0729412
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion 462_Gaze-LLE/demo/demo_yolov9_onnx_gazelle.py
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,14 @@ def check_positive(value):
help=\
'The attribute score threshold for object detection. Default: 0.70',
)
parser.add_argument(
'-cst',
'--centroid_socre_threshold',
type=float,
default=0.30,
help=\
'The heatmap centroid score threshold. Default: 0.30',
)
parser.add_argument(
'-dnm',
'--disable_generation_identification_mode',
Expand Down Expand Up @@ -1008,6 +1016,7 @@ def check_positive(value):
disable_waitKey: bool = args.disable_waitKey
object_socre_threshold: float = args.object_socre_threshold
attribute_socre_threshold: float = args.attribute_socre_threshold
centroid_socre_threshold: float = args.centroid_socre_threshold
disable_generation_identification_mode: bool = args.disable_generation_identification_mode
disable_gender_identification_mode: bool = args.disable_gender_identification_mode
disable_left_and_right_hand_identification_mode: bool = args.disable_left_and_right_hand_identification_mode
Expand Down Expand Up @@ -1406,7 +1415,7 @@ def calculate_centroid(heatmap: np.ndarray) -> Tuple[int, int, float]:
# Drawing of the point of gaze
for head_box, heatmap in zip(head_boxes, heatmaps):
cx, cy, score = calculate_centroid(heatmap)
if score >= 0.30:
if score >= centroid_socre_threshold:
cv2.line(debug_image, (head_box.cx, head_box.cy), (cx, cy), (255, 255, 255), thickness=3, lineType=cv2.LINE_AA)
cv2.line(debug_image, (head_box.cx, head_box.cy), (cx, cy), (0, 255, 0), thickness=2, lineType=cv2.LINE_AA)
cv2.circle(debug_image, (cx, cy), 4, (255, 255, 255), thickness=-1, lineType=cv2.LINE_AA)
Expand Down

0 comments on commit 0729412

Please sign in to comment.