Spaces:
Sleeping
Sleeping
AI-RESEARCHER-2024
commited on
Commit
•
1de30b3
1
Parent(s):
4520520
Update app.py
Browse files
app.py
CHANGED
@@ -77,6 +77,9 @@ class ImageProcessor:
|
|
77 |
for box in result.boxes:
|
78 |
x1, y1, x2, y2 = [round(x) for x in box.xyxy[0].tolist()]
|
79 |
class_id = box.cls[0].item()
|
|
|
|
|
|
|
80 |
prob = round(box.conf[0].item(), 2)
|
81 |
label = f"{result.names[class_id]}: {prob}"
|
82 |
draw.rectangle([x1, y1, x2, y2], outline="red", width=2)
|
|
|
77 |
for box in result.boxes:
|
78 |
x1, y1, x2, y2 = [round(x) for x in box.xyxy[0].tolist()]
|
79 |
class_id = box.cls[0].item()
|
80 |
+
# check if the class is tooth
|
81 |
+
if result.names[class_id].lower() == "tooth":
|
82 |
+
continue
|
83 |
prob = round(box.conf[0].item(), 2)
|
84 |
label = f"{result.names[class_id]}: {prob}"
|
85 |
draw.rectangle([x1, y1, x2, y2], outline="red", width=2)
|