Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,13 +15,13 @@ if uploaded_file is not None:
|
|
| 15 |
image = Image.open(uploaded_file)
|
| 16 |
|
| 17 |
# Inference
|
| 18 |
-
results = model(image)
|
| 19 |
|
| 20 |
# Display the image with bounding boxes
|
| 21 |
st.image(image, channels="RGB", caption="Object Detection Result", use_column_width=True)
|
| 22 |
|
| 23 |
# Display probability and class for each box
|
| 24 |
-
for det in results.xyxy[0]:
|
| 25 |
label = int(det[5])
|
| 26 |
score = float(det[4])
|
| 27 |
box = det[:4].tolist()
|
|
|
|
| 15 |
image = Image.open(uploaded_file)
|
| 16 |
|
| 17 |
# Inference
|
| 18 |
+
results = model.predict(image)
|
| 19 |
|
| 20 |
# Display the image with bounding boxes
|
| 21 |
st.image(image, channels="RGB", caption="Object Detection Result", use_column_width=True)
|
| 22 |
|
| 23 |
# Display probability and class for each box
|
| 24 |
+
for det in results.boxes.xyxy[0]:
|
| 25 |
label = int(det[5])
|
| 26 |
score = float(det[4])
|
| 27 |
box = det[:4].tolist()
|