gskdsrikrishna commited on
Commit
df0a6c7
·
verified ·
1 Parent(s): 9e7ecb8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -26,7 +26,8 @@ if st.button("Extract Head"):
26
  with st.spinner("Extracting head..."):
27
  result = extract_head(uploaded_file)
28
 
29
- head_url = result.get("head_image_url")
 
30
  if head_url:
31
  st.image(head_url, caption="Extracted Head", use_container_width=True)
32
 
@@ -41,4 +42,4 @@ if st.button("Extract Head"):
41
  st.error("Failed to extract head. No image URL found in response.")
42
  st.write("Response Data:", result) # Debugging: Show response data
43
  else:
44
- st.warning("Please upload an image.")
 
26
  with st.spinner("Extracting head..."):
27
  result = extract_head(uploaded_file)
28
 
29
+ # Extract image URL from JSON response
30
+ head_url = result.get("message", {}).get("head_image_url")
31
  if head_url:
32
  st.image(head_url, caption="Extracted Head", use_container_width=True)
33
 
 
42
  st.error("Failed to extract head. No image URL found in response.")
43
  st.write("Response Data:", result) # Debugging: Show response data
44
  else:
45
+ st.warning("Please upload an image.")