Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -53,7 +53,8 @@ def detect_object(IMAGE_PATH):
|
|
53 |
filtered_labels = [labels[i] for i in num_list]
|
54 |
show_labeled_image(image, filtered_boxes, filtered_labels)
|
55 |
|
56 |
-
show_image(image,filtered_boxes,filtered_labels)
|
|
|
57 |
#img_array = img_to_array(img)
|
58 |
def show_image(image, boxes, labels=None):
|
59 |
"""Show the image along with the specified boxes around detected objects.
|
@@ -107,6 +108,7 @@ def show_image(image, boxes, labels=None):
|
|
107 |
cp = os.path.abspath(os.getcwd()) + '/foo.png'
|
108 |
plt.savefig(cp)
|
109 |
plt.close(fig)
|
|
|
110 |
#print(type(plt
|
111 |
|
112 |
file = st.file_uploader('Upload an Image',type=(["jpeg","jpg","png"]))
|
|
|
53 |
filtered_labels = [labels[i] for i in num_list]
|
54 |
show_labeled_image(image, filtered_boxes, filtered_labels)
|
55 |
|
56 |
+
fig1 = show_image(image,filtered_boxes,filtered_labels)
|
57 |
+
st.image(fig1)
|
58 |
#img_array = img_to_array(img)
|
59 |
def show_image(image, boxes, labels=None):
|
60 |
"""Show the image along with the specified boxes around detected objects.
|
|
|
108 |
cp = os.path.abspath(os.getcwd()) + '/foo.png'
|
109 |
plt.savefig(cp)
|
110 |
plt.close(fig)
|
111 |
+
return cp
|
112 |
#print(type(plt
|
113 |
|
114 |
file = st.file_uploader('Upload an Image',type=(["jpeg","jpg","png"]))
|