Spaces:
Runtime error
Runtime error
Commit
•
7a4c41f
1
Parent(s):
a44470c
first commit
Browse files
app.py
CHANGED
@@ -12,10 +12,12 @@ if uploaded_file is not None:
|
|
12 |
st.image(image, caption='Uploaded Image.', use_column_width=True)
|
13 |
st.write("")
|
14 |
prompt = st.text_input(f"Detect the main object in the image. The image is a")
|
|
|
|
|
15 |
if st.button('Classify'):
|
16 |
st.write(f"User: {prompt}")
|
17 |
with st.spinner('Processing...'):
|
18 |
-
label = kosmos.single_image_classification(image, prompt,
|
19 |
st.write(f"Model: {label}")
|
20 |
except Exception as e:
|
21 |
st.error(f"An error occurred: {e}")
|
|
|
12 |
st.image(image, caption='Uploaded Image.', use_column_width=True)
|
13 |
st.write("")
|
14 |
prompt = st.text_input(f"Detect the main object in the image. The image is a")
|
15 |
+
num_characters = st.chat_input("20")
|
16 |
+
num_characters = int(num_characters)
|
17 |
if st.button('Classify'):
|
18 |
st.write(f"User: {prompt}")
|
19 |
with st.spinner('Processing...'):
|
20 |
+
label = kosmos.single_image_classification(image, prompt, num_characters)
|
21 |
st.write(f"Model: {label}")
|
22 |
except Exception as e:
|
23 |
st.error(f"An error occurred: {e}")
|