Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -108,7 +108,7 @@ def detect_objects_in_image(image):
|
|
108 |
|
109 |
# Generate and return graph instead of dictionary
|
110 |
# graph_image = generate_vehicle_count_graph(object_counts)
|
111 |
-
|
112 |
return Image.fromarray(img_array)#, graph_image # Now returning only 2 outputs
|
113 |
|
114 |
|
@@ -158,7 +158,7 @@ def generate_vehicle_count_graph(object_counts):
|
|
158 |
buf.seek(0)
|
159 |
|
160 |
plt.close(fig) # ✅ CLOSE THE FIGURE TO FREE MEMORY
|
161 |
-
|
162 |
return Image.open(buf)
|
163 |
|
164 |
|
@@ -192,6 +192,7 @@ def detect_objects_in_video(video_input):
|
|
192 |
|
193 |
cap.release()
|
194 |
out.release()
|
|
|
195 |
|
196 |
return temp_video_output, graph_image # Return both expected outputs
|
197 |
|
@@ -216,6 +217,7 @@ title = "SpecLab Demo"
|
|
216 |
description = "<p style='text-align: center'>Gradio demo for an ASPP model architecture trained on the SpecLab dataset. To use it, simply add your image, or click one of the examples to load them. Since this demo is run on CPU only, please allow additional time for processing. </p>"
|
217 |
article = "<p style='text-align: center'><a href='https://github.com/Nano1337/SpecLab'>Github Repo</a></p>"
|
218 |
css = "#0 {object-fit: contain;} #1 {object-fit: contain;}"
|
|
|
219 |
demo = gr.Interface(fn=detect_objects_in_image,
|
220 |
title=title,
|
221 |
description=description,
|
|
|
108 |
|
109 |
# Generate and return graph instead of dictionary
|
110 |
# graph_image = generate_vehicle_count_graph(object_counts)
|
111 |
+
print(Image.fromarray(img_array))
|
112 |
return Image.fromarray(img_array)#, graph_image # Now returning only 2 outputs
|
113 |
|
114 |
|
|
|
158 |
buf.seek(0)
|
159 |
|
160 |
plt.close(fig) # ✅ CLOSE THE FIGURE TO FREE MEMORY
|
161 |
+
print("checkl1")
|
162 |
return Image.open(buf)
|
163 |
|
164 |
|
|
|
192 |
|
193 |
cap.release()
|
194 |
out.release()
|
195 |
+
print("checl2")
|
196 |
|
197 |
return temp_video_output, graph_image # Return both expected outputs
|
198 |
|
|
|
217 |
description = "<p style='text-align: center'>Gradio demo for an ASPP model architecture trained on the SpecLab dataset. To use it, simply add your image, or click one of the examples to load them. Since this demo is run on CPU only, please allow additional time for processing. </p>"
|
218 |
article = "<p style='text-align: center'><a href='https://github.com/Nano1337/SpecLab'>Github Repo</a></p>"
|
219 |
css = "#0 {object-fit: contain;} #1 {object-fit: contain;}"
|
220 |
+
print("chek3")
|
221 |
demo = gr.Interface(fn=detect_objects_in_image,
|
222 |
title=title,
|
223 |
description=description,
|