Spaces:
Sleeping
Sleeping
jocko
commited on
Commit
·
896e28f
1
Parent(s):
78e9afc
fix image similarity detection
Browse files- src/streamlit_app.py +3 -0
src/streamlit_app.py
CHANGED
|
@@ -169,6 +169,7 @@ if query:
|
|
| 169 |
st.warning("OpenAI API key not found. Please set OPENAI_API_KEY as a secret environment variable.")
|
| 170 |
|
| 171 |
if uploaded_file is not None:
|
|
|
|
| 172 |
print(uploaded_file)
|
| 173 |
query_image = Image.open(uploaded_file).convert("RGB")
|
| 174 |
st.image(query_image, caption="Your uploaded image", use_container_width=True)
|
|
@@ -192,5 +193,7 @@ if uploaded_file is not None:
|
|
| 192 |
similar_img = data[int(idx)]['image']
|
| 193 |
st.image(similar_img, caption=f"Similarity: {score:.3f}", use_container_width=True)
|
| 194 |
st.markdown(f"**Case description:** {data[int(idx)]['complaints']}")
|
|
|
|
|
|
|
| 195 |
|
| 196 |
st.caption("This chatbot is for educational purposes only and does not provide medical advice.")
|
|
|
|
| 169 |
st.warning("OpenAI API key not found. Please set OPENAI_API_KEY as a secret environment variable.")
|
| 170 |
|
| 171 |
if uploaded_file is not None:
|
| 172 |
+
print('uploading file')
|
| 173 |
print(uploaded_file)
|
| 174 |
query_image = Image.open(uploaded_file).convert("RGB")
|
| 175 |
st.image(query_image, caption="Your uploaded image", use_container_width=True)
|
|
|
|
| 193 |
similar_img = data[int(idx)]['image']
|
| 194 |
st.image(similar_img, caption=f"Similarity: {score:.3f}", use_container_width=True)
|
| 195 |
st.markdown(f"**Case description:** {data[int(idx)]['complaints']}")
|
| 196 |
+
else:
|
| 197 |
+
print("no image")
|
| 198 |
|
| 199 |
st.caption("This chatbot is for educational purposes only and does not provide medical advice.")
|