Spaces:
Sleeping
Sleeping
tonyliu404
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -379,25 +379,27 @@ sample_RAG = {
|
|
379 |
col1, col2 = st.columns(2)
|
380 |
with col1:
|
381 |
st.title("Image Classification Result")
|
382 |
-
if not uploaded_image:
|
383 |
placeholder = Image.open("dish-placeholder.jpg")
|
384 |
st.image(placeholder, caption="Placeholder Image.", use_container_width=True)
|
385 |
st.header("Top Predictions:")
|
386 |
st.markdown(f"*Donuts*: 98.11%")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
387 |
with col2:
|
388 |
st.title('RAG Recipe Result')
|
389 |
-
if not query and not uploaded_image:
|
390 |
display_response(sample_RAG)
|
391 |
|
|
|
392 |
# Image Classification Section
|
393 |
if recipe_submit and uploaded_image:
|
394 |
with col1:
|
395 |
-
# Open the image
|
396 |
-
input_image = Image.open(uploaded_image)
|
397 |
-
|
398 |
-
# Display the image
|
399 |
-
st.image(input_image, caption="Uploaded Image.", use_container_width=True)
|
400 |
-
|
401 |
predictions = classifyImage(input_image)
|
402 |
print("Predictions: ", predictions)
|
403 |
fpredictions = ""
|
|
|
379 |
col1, col2 = st.columns(2)
|
380 |
with col1:
|
381 |
st.title("Image Classification Result")
|
382 |
+
if not uploaded_image and not recipe_submit:
|
383 |
placeholder = Image.open("dish-placeholder.jpg")
|
384 |
st.image(placeholder, caption="Placeholder Image.", use_container_width=True)
|
385 |
st.header("Top Predictions:")
|
386 |
st.markdown(f"*Donuts*: 98.11%")
|
387 |
+
|
388 |
+
if uploaded_image:
|
389 |
+
# Open the image
|
390 |
+
input_image = Image.open(uploaded_image)
|
391 |
+
|
392 |
+
# Display the image
|
393 |
+
st.image(input_image, caption="Uploaded Image.", use_container_width=True)
|
394 |
with col2:
|
395 |
st.title('RAG Recipe Result')
|
396 |
+
if not query and not uploaded_image and not recipe_submit:
|
397 |
display_response(sample_RAG)
|
398 |
|
399 |
+
|
400 |
# Image Classification Section
|
401 |
if recipe_submit and uploaded_image:
|
402 |
with col1:
|
|
|
|
|
|
|
|
|
|
|
|
|
403 |
predictions = classifyImage(input_image)
|
404 |
print("Predictions: ", predictions)
|
405 |
fpredictions = ""
|