Spaces:
Running
Running
design changes
Browse files
app.py
CHANGED
@@ -303,6 +303,10 @@ with st.expander("**What is FOOD CHAIN?**"):
|
|
303 |
Made by the Classify Crew: [Contact List](https://linktr.ee/classifycrew)
|
304 |
"""
|
305 |
)
|
|
|
|
|
|
|
|
|
306 |
#################
|
307 |
|
308 |
# Image Classification Section
|
@@ -319,7 +323,7 @@ if uploaded_image and query:
|
|
319 |
fpredictions = ""
|
320 |
|
321 |
# Show the top predictions with percentages
|
322 |
-
st.
|
323 |
for class_name, confidence in predictions:
|
324 |
if int(confidence) > 0.05:
|
325 |
fpredictions += f"{class_name}: {confidence:.2f}%,"
|
@@ -351,11 +355,11 @@ if uploaded_image and query:
|
|
351 |
openAIresponse = llm.invoke(openAICall)
|
352 |
print("AI CALL RESPONSE: ", openAIresponse.content)
|
353 |
|
|
|
354 |
with st.expander("Recipe Generation", expanded=True, icon=':material/menu_book:'):
|
355 |
st.title('Results: RAG')
|
356 |
# RAG the openai response and display
|
357 |
print("RAG INPUT", openAIresponse.content + " " + query)
|
358 |
-
RAGresponse = get_response(openAIresponse.content + " " + query)
|
359 |
display_response(RAGresponse)
|
360 |
elif uploaded_image is not None:
|
361 |
with st.expander("**Food Classification**", expanded=True, icon=':material/search_insights:'):
|
@@ -371,7 +375,7 @@ elif uploaded_image is not None:
|
|
371 |
fpredictions = ""
|
372 |
|
373 |
# Show the top predictions with percentages
|
374 |
-
st.
|
375 |
for class_name, confidence in predictions:
|
376 |
if int(confidence) > 0.05:
|
377 |
fpredictions += f"{class_name}: {confidence:.2f}%,"
|
@@ -382,9 +386,9 @@ elif uploaded_image is not None:
|
|
382 |
print(fpredictions)
|
383 |
|
384 |
elif query:
|
385 |
-
|
|
|
386 |
st.title("Results: RAG")
|
387 |
-
response = get_response(query)
|
388 |
display_response(response)
|
389 |
else:
|
390 |
st.warning("Please input an image and/or a prompt.", icon=':material/no_meals:')
|
|
|
303 |
Made by the Classify Crew: [Contact List](https://linktr.ee/classifycrew)
|
304 |
"""
|
305 |
)
|
306 |
+
if st.theme() == 'Dark':
|
307 |
+
st.image('logo-dark.png', caption="Uploaded Image.", use_container_width=True)
|
308 |
+
else:
|
309 |
+
st.image('logo-light.png', caption="Uploaded Image.", use_container_width=True)
|
310 |
#################
|
311 |
|
312 |
# Image Classification Section
|
|
|
323 |
fpredictions = ""
|
324 |
|
325 |
# Show the top predictions with percentages
|
326 |
+
st.markdown("**Top Predictions:**")
|
327 |
for class_name, confidence in predictions:
|
328 |
if int(confidence) > 0.05:
|
329 |
fpredictions += f"{class_name}: {confidence:.2f}%,"
|
|
|
355 |
openAIresponse = llm.invoke(openAICall)
|
356 |
print("AI CALL RESPONSE: ", openAIresponse.content)
|
357 |
|
358 |
+
RAGresponse = get_response(openAIresponse.content + " " + query)
|
359 |
with st.expander("Recipe Generation", expanded=True, icon=':material/menu_book:'):
|
360 |
st.title('Results: RAG')
|
361 |
# RAG the openai response and display
|
362 |
print("RAG INPUT", openAIresponse.content + " " + query)
|
|
|
363 |
display_response(RAGresponse)
|
364 |
elif uploaded_image is not None:
|
365 |
with st.expander("**Food Classification**", expanded=True, icon=':material/search_insights:'):
|
|
|
375 |
fpredictions = ""
|
376 |
|
377 |
# Show the top predictions with percentages
|
378 |
+
st.markdown("**Top Predictions:**")
|
379 |
for class_name, confidence in predictions:
|
380 |
if int(confidence) > 0.05:
|
381 |
fpredictions += f"{class_name}: {confidence:.2f}%,"
|
|
|
386 |
print(fpredictions)
|
387 |
|
388 |
elif query:
|
389 |
+
response = get_response(query)
|
390 |
+
with st.expander("**Recipe Generation**", expanded=True, icon=':material/menu_book:'):
|
391 |
st.title("Results: RAG")
|
|
|
392 |
display_response(response)
|
393 |
else:
|
394 |
st.warning("Please input an image and/or a prompt.", icon=':material/no_meals:')
|