Skip to content

Commit

Permalink
feat: confidence to distance
Browse files Browse the repository at this point in the history
  • Loading branch information
m-barker committed Feb 9, 2024
1 parent 7b7068e commit a82d983
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion common/vision/lasr_vision_deepface/nodes/service
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def detect(request: RecogniseRequest) -> RecogniseResponse:
f"/recognise/debug/{topic_name}/similar_face", Image, queue_size=1
)
cropped_face_publisher = rospy.Publisher(
"/learn_face/debug/cropped_query_face", Image, queue_size=1
"/recognise/debug/cropped_query_face", Image, queue_size=1
)
recognise_debug_publishers[request.dataset] = (
debug_publisher,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def detect(
row["source_h"][0],
)
detection.xywh = [x, y, w, h]
detection.confidence = 1.0 - row["distance"][0]
detection.confidence = row["distance"][0]
response.detections.append(detection)

cropped_image = cv_im[:][y : y + h, x : x + w]
Expand All @@ -162,7 +162,7 @@ def detect(
cv2.rectangle(cv_im, (x, y), (x + w, y + h), (0, 0, 255), 2)
cv2.putText(
cv_im,
f"{detection.name} ({detection.confidence})",
f"{detection.name} Distance: ({detection.confidence:.2f})",
(x, y - 5),
cv2.FONT_HERSHEY_SIMPLEX,
0.5,
Expand Down

0 comments on commit a82d983

Please sign in to comment.