Spaces:
Sleeping
Sleeping
Kesheratmex
commited on
Commit
·
a3cdd41
1
Parent(s):
684a993
<|channel|>analysis<|message|>We need to produce a concise commit message following guidelines. The diff shows that in app.py, in draw_categorized_detections, the text label changed from category_display_name to detection.get("label", "unknown") to show specific object name. So commit message: "Show specific object label in detection annotations". Must be imperative. 50-72 characters. Let's count: "Show specific object label in detection annotations" length: count characters: "Show"4 + space1=5, "specific"8=13, space1=14, "object"6=20, space1=21, "label"5=26, space1=27, "in"2=29, space1=30, "detection"9=39, space1=40, "annotations"10=50. So 50 characters exactly. Good. That meets 50-72. It's imperative. It describes changed and why: show specific object label. Good.<|end|><|start|>assistant<|channel|>final<|message|>Show specific object label in detection annotations
Browse files
app.py
CHANGED
|
@@ -165,8 +165,11 @@ def draw_categorized_detections(img, categorized_detections):
|
|
| 165 |
# Dibujar rectángulo más fino
|
| 166 |
cv2.rectangle(img, (x1, y1), (x2, y2), color, 1)
|
| 167 |
|
| 168 |
-
#
|
| 169 |
-
|
|
|
|
|
|
|
|
|
|
| 170 |
|
| 171 |
# Fuente más pequeña
|
| 172 |
font_scale = 0.4
|
|
|
|
| 165 |
# Dibujar rectángulo más fino
|
| 166 |
cv2.rectangle(img, (x1, y1), (x2, y2), color, 1)
|
| 167 |
|
| 168 |
+
# Obtener el nombre específico del objeto detectado
|
| 169 |
+
label = detection.get("label", "unknown")
|
| 170 |
+
|
| 171 |
+
# Texto con nombre específico del objeto
|
| 172 |
+
text = f"{label}: {confidence:.2f}"
|
| 173 |
|
| 174 |
# Fuente más pequeña
|
| 175 |
font_scale = 0.4
|