Update app.py
Browse files
app.py
CHANGED
|
@@ -56,7 +56,7 @@ def detect_objects(frame):
|
|
| 56 |
|
| 57 |
return detections
|
| 58 |
|
| 59 |
-
def display_detections(
|
| 60 |
for det in detections:
|
| 61 |
x1, y1, x2, y2, conf, detected_name = det
|
| 62 |
color = colors.get(detected_name, (255, 255, 255))
|
|
@@ -78,7 +78,9 @@ def app():
|
|
| 78 |
image = Image.open(uploaded_file)
|
| 79 |
st.image(image, caption="Uploaded Image", use_column_width=True)
|
| 80 |
detections = detect_objects(np.array(image))
|
| 81 |
-
display_detections(image, detections)
|
|
|
|
|
|
|
| 82 |
|
| 83 |
elif input_type == "Video":
|
| 84 |
st.write("Select an option to get the input video:")
|
|
|
|
| 56 |
|
| 57 |
return detections
|
| 58 |
|
| 59 |
+
def display_detections(input_image, output_image, detections):
|
| 60 |
for det in detections:
|
| 61 |
x1, y1, x2, y2, conf, detected_name = det
|
| 62 |
color = colors.get(detected_name, (255, 255, 255))
|
|
|
|
| 78 |
image = Image.open(uploaded_file)
|
| 79 |
st.image(image, caption="Uploaded Image", use_column_width=True)
|
| 80 |
detections = detect_objects(np.array(image))
|
| 81 |
+
output_image = display_detections(np.array(image), np.array(image), detections)
|
| 82 |
+
st.image(output_image, caption="Output Image", use_column_width=True)
|
| 83 |
+
|
| 84 |
|
| 85 |
elif input_type == "Video":
|
| 86 |
st.write("Select an option to get the input video:")
|