Update app.py
Browse files
app.py
CHANGED
@@ -68,7 +68,7 @@ if uploaded_image is not None:
|
|
68 |
st.image(image, caption="Uploaded Image", use_column_width=True)
|
69 |
image_binary = image_bytes.getvalue()
|
70 |
# Task prompt input
|
71 |
-
task_prompt = st.sidebar.text_input("Task Prompt", value="
|
72 |
# Additional text input (optional)
|
73 |
text_input = st.sidebar.text_area("Input Questions", height=20)
|
74 |
# Generate Caption button
|
@@ -77,9 +77,7 @@ if uploaded_image is not None:
|
|
77 |
st.session_state.has_run = True
|
78 |
st.write(task_prompt,"\n\n",text_input)
|
79 |
inference.demo()
|
80 |
-
task_prompt = '<MORE_DETAILED_CAPTION>'
|
81 |
-
text_input="Describe this image in detail:" # kosmos-2 prompt implement here
|
82 |
output=inference.run_example(image,st.session_state.model,st.session_state.processor,task_prompt,text_input)
|
83 |
-
st.write(output)
|
84 |
|
85 |
|
|
|
68 |
st.image(image, caption="Uploaded Image", use_column_width=True)
|
69 |
image_binary = image_bytes.getvalue()
|
70 |
# Task prompt input
|
71 |
+
task_prompt = st.sidebar.text_input("Task Prompt", value="<MORE_DETAILED_CAPTION>")
|
72 |
# Additional text input (optional)
|
73 |
text_input = st.sidebar.text_area("Input Questions", height=20)
|
74 |
# Generate Caption button
|
|
|
77 |
st.session_state.has_run = True
|
78 |
st.write(task_prompt,"\n\n",text_input)
|
79 |
inference.demo()
|
|
|
|
|
80 |
output=inference.run_example(image,st.session_state.model,st.session_state.processor,task_prompt,text_input)
|
81 |
+
st.write(output.split(":")[1])
|
82 |
|
83 |
|