Spaces:
Runtime error
Runtime error
app.py
CHANGED
@@ -20,7 +20,7 @@ if(input_image):
|
|
20 |
response = requests.post(os.path.join(api, "bounding-boxes/"), files = {"file": input_image.getvalue()})
|
21 |
prediction = ast.literal_eval(response.text)
|
22 |
response = requests.post(os.path.join(api, "image-w-boxes/"), files = {"file": input_image.getvalue()})
|
23 |
-
|
24 |
arr = []
|
25 |
for b in prediction["bboxes"]:
|
26 |
stamp = image.crop((b["xmin"], b["ymin"], b["xmin"] + b["width"], b["ymin"] + b["height"]))
|
@@ -34,6 +34,6 @@ if(input_image):
|
|
34 |
col1.write(prediction)
|
35 |
|
36 |
col2.subheader("Image")
|
37 |
-
col2.image(
|
38 |
|
39 |
st.write(arr)
|
|
|
20 |
response = requests.post(os.path.join(api, "bounding-boxes/"), files = {"file": input_image.getvalue()})
|
21 |
prediction = ast.literal_eval(response.text)
|
22 |
response = requests.post(os.path.join(api, "image-w-boxes/"), files = {"file": input_image.getvalue()})
|
23 |
+
image_with_boxes = response.content
|
24 |
arr = []
|
25 |
for b in prediction["bboxes"]:
|
26 |
stamp = image.crop((b["xmin"], b["ymin"], b["xmin"] + b["width"], b["ymin"] + b["height"]))
|
|
|
34 |
col1.write(prediction)
|
35 |
|
36 |
col2.subheader("Image")
|
37 |
+
col2.image(image_with_boxes, use_column_width=True)
|
38 |
|
39 |
st.write(arr)
|