Spaces:
Running
on
Zero
Running
on
Zero
Martin Tomov
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -66,7 +66,7 @@ def annotate_with_transparency(image: Union[Image.Image, np.ndarray], detection_
|
|
66 |
cv2.drawContours(overlay, contours, -1, color, -1) # Draw filled contours on the overlay
|
67 |
|
68 |
# Blend the overlay with the original image
|
69 |
-
alpha = 0.
|
70 |
image_cv2 = cv2.addWeighted(overlay, alpha, image_cv2, 1 - alpha, 0)
|
71 |
|
72 |
cv2.putText(image_cv2, f'{label}: {score:.2f}', (box.xmin, box.ymin - 10),
|
|
|
66 |
cv2.drawContours(overlay, contours, -1, color, -1) # Draw filled contours on the overlay
|
67 |
|
68 |
# Blend the overlay with the original image
|
69 |
+
alpha = 0.1 # Adjust the alpha value to control transparency
|
70 |
image_cv2 = cv2.addWeighted(overlay, alpha, image_cv2, 1 - alpha, 0)
|
71 |
|
72 |
cv2.putText(image_cv2, f'{label}: {score:.2f}', (box.xmin, box.ymin - 10),
|