Spaces:
Running
Running
Upload folder using huggingface_hub
Browse filesFiles changed (2)
365 unmodified lines366367368369369370371372373372374375376375377378379380365 unmodified lines card_u8 = _prepare(card_mask)
# Solid contours only — no tinted fill, so the underlying photo stays # at full brightness inside the SAM silhouettes. # at full brightness inside the SAM silhouettes. Drawn at thickness 4 # so the silhouette reads as the primary outline; the internal hand # skeleton uses a thinner stroke so it stays a supporting reference. if hand_u8 is not None: contours, _ = cv2.findContours(hand_u8, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE) cv2.drawContours(out, contours, -1, Color.CONTOUR, 2, cv2.LINE_AA) cv2.drawContours(out, contours, -1, Color.CONTOUR, 4, cv2.LINE_AA) if card_u8 is not None: contours, _ = cv2.findContours(card_u8, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE) cv2.drawContours(out, contours, -1, Color.CONTOUR, 2, cv2.LINE_AA) cv2.drawContours(out, contours, -1, Color.CONTOUR, 4, cv2.LINE_AA)
return out
188 unmodified lines189190191192193194195196195197198199200188 unmodified lines
# Draw connections in the shared CONTOUR color so the skeleton matches # the hand silhouette and stays distinct from the per-finger band colors. # Thickness 2 (vs. the silhouette's 4) keeps the skeleton as a supporting # internal reference rather than competing with the outer contour. for idx1, idx2 in HAND_CONNECTIONS: pt1 = (int(landmarks[idx1, 0]), int(landmarks[idx1, 1])) pt2 = (int(landmarks[idx2, 0]), int(landmarks[idx2, 1])) cv2.line(overlay, pt1, pt2, Color.CONTOUR, Size.LINE_THICK, cv2.LINE_AA) cv2.line(overlay, pt1, pt2, Color.CONTOUR, 2, cv2.LINE_AA)
# Draw landmarks on top for i, (x, y) in enumerate(landmarks):measure_finger.py+5-3
src/debug_observer.py+3-1