Spaces:
Runtime error
Runtime error
add a button to apply tags
Browse files
app.py
CHANGED
|
@@ -38,11 +38,12 @@ st.title('Upload an image file to detection')
|
|
| 38 |
|
| 39 |
uploaded_image_zero_file = st.file_uploader("Choose an image file (zero)")
|
| 40 |
texts = st.text_input('tags')
|
| 41 |
-
image = ''
|
| 42 |
if uploaded_image_zero_file is not None:
|
| 43 |
image = Image.open(uploaded_image_zero_file)
|
| 44 |
outputImage = np.array(image)
|
| 45 |
st.image(outputImage)
|
|
|
|
|
|
|
| 46 |
tags = [texts.split(", ")]
|
| 47 |
inputs = processor(text=tags, images=image, return_tensors="pt")
|
| 48 |
outputs = model(**inputs)
|
|
|
|
| 38 |
|
| 39 |
uploaded_image_zero_file = st.file_uploader("Choose an image file (zero)")
|
| 40 |
texts = st.text_input('tags')
|
|
|
|
| 41 |
if uploaded_image_zero_file is not None:
|
| 42 |
image = Image.open(uploaded_image_zero_file)
|
| 43 |
outputImage = np.array(image)
|
| 44 |
st.image(outputImage)
|
| 45 |
+
|
| 46 |
+
if st.button('apply tag'):
|
| 47 |
tags = [texts.split(", ")]
|
| 48 |
inputs = processor(text=tags, images=image, return_tensors="pt")
|
| 49 |
outputs = model(**inputs)
|