Spaces:
Runtime error
Runtime error
add a button to apply tags
Browse files
app.py
CHANGED
|
@@ -57,7 +57,7 @@ if st.button('apply tag'):
|
|
| 57 |
candidate_labels=['eggs', 'apple', 'pear']
|
| 58 |
)
|
| 59 |
|
| 60 |
-
draw = ImageDraw.Draw(
|
| 61 |
|
| 62 |
for prediction in predictions:
|
| 63 |
box = prediction["box"]
|
|
@@ -68,6 +68,7 @@ if st.button('apply tag'):
|
|
| 68 |
draw.rectangle((xmin, ymin, xmax, ymax), outline="red", width=1)
|
| 69 |
draw.text((xmin, ymin), f"{label}: {round(score,2)}", fill="white")
|
| 70 |
|
| 71 |
-
|
|
|
|
| 72 |
st.write(predictions)
|
| 73 |
|
|
|
|
| 57 |
candidate_labels=['eggs', 'apple', 'pear']
|
| 58 |
)
|
| 59 |
|
| 60 |
+
draw = ImageDraw.Draw(image)
|
| 61 |
|
| 62 |
for prediction in predictions:
|
| 63 |
box = prediction["box"]
|
|
|
|
| 68 |
draw.rectangle((xmin, ymin, xmax, ymax), outline="red", width=1)
|
| 69 |
draw.text((xmin, ymin), f"{label}: {round(score,2)}", fill="white")
|
| 70 |
|
| 71 |
+
outputImageWithLabel = np.array(image)
|
| 72 |
+
st.image(outputImageWithLabel)
|
| 73 |
st.write(predictions)
|
| 74 |
|