Skip to content

Commit 018fca8

Browse files
Jon Mortonfacebook-github-bot
authored andcommitted
Visualizer: make keypoint threshold configurable
Summary: Make the keypoint threshold a class member, so it can be changed. Reviewed By: ppwwyyxx Differential Revision: D30690598 fbshipit-source-id: 29499eaf12257e5bb4871ea318dc4ab5523d304e
1 parent 6545979 commit 018fca8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

detectron2/utils/visualizer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@ def __init__(self, img_rgb, metadata=None, scale=1.0, instance_mode=ColorMode.IM
375375
np.sqrt(self.output.height * self.output.width) // 90, 10 // scale
376376
)
377377
self._instance_mode = instance_mode
378+
self.keypoint_threshold = _KEYPOINT_THRESHOLD
378379

379380
def draw_instance_predictions(self, predictions):
380381
"""
@@ -799,7 +800,7 @@ def draw_and_connect_keypoints(self, keypoints):
799800
for idx, keypoint in enumerate(keypoints):
800801
# draw keypoint
801802
x, y, prob = keypoint
802-
if prob > _KEYPOINT_THRESHOLD:
803+
if prob > self.keypoint_threshold:
803804
self.draw_circle((x, y), color=_RED)
804805
if keypoint_names:
805806
keypoint_name = keypoint_names[idx]

0 commit comments

Comments
 (0)