Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -49,17 +49,7 @@ def count_and_display_pie_chart(image, labels_text):
|
|
49 |
|
50 |
label_count = defaultdict(int)
|
51 |
|
52 |
-
# for i, (box, cls, conf) in enumerate(zip(boxes, classes, confidences)):
|
53 |
-
# x1, y1, x2, y2 = box
|
54 |
-
# confidence = conf
|
55 |
-
# detected_class = cls
|
56 |
-
# name = names[int(cls)]
|
57 |
|
58 |
-
# cropped_image = image.crop((int(x1), int(y1), int(x2), int(y2)))
|
59 |
-
|
60 |
-
# label_count[name] += 1
|
61 |
-
|
62 |
-
# Iterate through the results
|
63 |
for i, (box, cls, conf) in enumerate(zip(boxes, classes, confidences)):
|
64 |
x1, y1, x2, y2 = box
|
65 |
confidence = conf
|
@@ -72,7 +62,7 @@ def count_and_display_pie_chart(image, labels_text):
|
|
72 |
|
73 |
|
74 |
# Pass the cropped image through the 'shot' function
|
75 |
-
labels_text = 'PET bottle, Milk container, Soda can, Plastic cover' # Assuming 'name' contains the label text for the detected object
|
76 |
result = shot(cropped_image, labels_text)
|
77 |
|
78 |
# Find the label with the highest score
|
|
|
49 |
|
50 |
label_count = defaultdict(int)
|
51 |
|
|
|
|
|
|
|
|
|
|
|
52 |
|
|
|
|
|
|
|
|
|
|
|
53 |
for i, (box, cls, conf) in enumerate(zip(boxes, classes, confidences)):
|
54 |
x1, y1, x2, y2 = box
|
55 |
confidence = conf
|
|
|
62 |
|
63 |
|
64 |
# Pass the cropped image through the 'shot' function
|
65 |
+
#labels_text = 'PET bottle, Milk container, Soda can, Plastic cover' # Assuming 'name' contains the label text for the detected object
|
66 |
result = shot(cropped_image, labels_text)
|
67 |
|
68 |
# Find the label with the highest score
|