Spaces:
Runtime error
Runtime error
app.py
CHANGED
@@ -17,15 +17,9 @@ if(input_image):
|
|
17 |
st.image(input_image, use_column_width=True)
|
18 |
if st.button("Get prediction"):
|
19 |
with st.spinner("Loading..."):
|
20 |
-
col1, col2 = st.columns(2)
|
21 |
-
col1.subheader("Prediction")
|
22 |
response = requests.post(os.path.join(api, "bounding-boxes/"), files = {"file": input_image.getvalue()})
|
23 |
prediction = ast.literal_eval(response.text)
|
24 |
-
col1.write(prediction)
|
25 |
-
|
26 |
-
col2.subheader("Image")
|
27 |
response = requests.post(os.path.join(api, "image-w-boxes/"), files = {"file": input_image.getvalue()})
|
28 |
-
col2.image(response.content, use_column_width=True)
|
29 |
|
30 |
arr = []
|
31 |
for b in prediction["bboxes"]:
|
@@ -35,4 +29,11 @@ if(input_image):
|
|
35 |
response = ast.literal_eval(requests.post(os.path.join(api, "embeddings-from-cropped/"), files = {"file": output.getvalue()}).text)
|
36 |
arr.extend(response["embedding"])
|
37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
st.write(arr)
|
|
|
17 |
st.image(input_image, use_column_width=True)
|
18 |
if st.button("Get prediction"):
|
19 |
with st.spinner("Loading..."):
|
|
|
|
|
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"]:
|
|
|
29 |
response = ast.literal_eval(requests.post(os.path.join(api, "embeddings-from-cropped/"), files = {"file": output.getvalue()}).text)
|
30 |
arr.extend(response["embedding"])
|
31 |
|
32 |
+
col1, col2 = st.columns(2)
|
33 |
+
col1.subheader("Prediction")
|
34 |
+
col1.write(prediction)
|
35 |
+
|
36 |
+
col2.subheader("Image")
|
37 |
+
col2.image(response.content, use_column_width=True)
|
38 |
+
|
39 |
st.write(arr)
|