Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,6 +13,16 @@ st.title('Upload an image file to detection')
|
|
| 13 |
uploaded_image_zero_file = st.file_uploader("Choose an image file (zero)")
|
| 14 |
|
| 15 |
imageLocation = st.empty()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
if st.button('apply tag'):
|
| 17 |
tags = [['products', 'price', 'title']]
|
| 18 |
|
|
@@ -29,15 +39,4 @@ if st.button('apply tag'):
|
|
| 29 |
|
| 30 |
imageLocation.image(image)
|
| 31 |
st.write(predictions)
|
| 32 |
-
|
| 33 |
-
if uploaded_image_zero_file is not None:
|
| 34 |
-
image = Image.open(uploaded_image_zero_file)
|
| 35 |
-
outputImage = np.array(image)
|
| 36 |
-
predictions = detector(
|
| 37 |
-
image,
|
| 38 |
-
candidate_labels=['product']
|
| 39 |
-
)
|
| 40 |
-
imageLocation.image(outputImage)
|
| 41 |
-
|
| 42 |
-
|
| 43 |
|
|
|
|
| 13 |
uploaded_image_zero_file = st.file_uploader("Choose an image file (zero)")
|
| 14 |
|
| 15 |
imageLocation = st.empty()
|
| 16 |
+
|
| 17 |
+
if uploaded_image_zero_file is not None:
|
| 18 |
+
image = Image.open(uploaded_image_zero_file)
|
| 19 |
+
outputImage = np.array(image)
|
| 20 |
+
predictions = detector(
|
| 21 |
+
image,
|
| 22 |
+
candidate_labels=['product']
|
| 23 |
+
)
|
| 24 |
+
imageLocation.image(outputImage)
|
| 25 |
+
|
| 26 |
if st.button('apply tag'):
|
| 27 |
tags = [['products', 'price', 'title']]
|
| 28 |
|
|
|
|
| 39 |
|
| 40 |
imageLocation.image(image)
|
| 41 |
st.write(predictions)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
|