Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -66,15 +66,15 @@ if uploaded_file is not None:
|
|
66 |
with st.spinner("Analyzing the image..."):
|
67 |
gender = query_analysis(image_bytes, "What is the gender of the person in the image?")
|
68 |
clothing = query_analysis(image_bytes, "What is the person wearing and which color?")
|
69 |
-
hair_color = query_analysis(image_bytes, "What is the hair color of the person?")
|
70 |
-
facial_expression = query_analysis(image_bytes, "What is the facial expression of the person?")
|
71 |
age = query_analysis(image_bytes, "What is the estimated age of the person?")
|
72 |
|
73 |
# Build generation prompt based on VQA responses and user input
|
74 |
if gender.lower() == "female":
|
75 |
-
prompt = f"Create a {age}-year-old girl with {hair_color} hair, wearing {clothing}, showing a {facial_expression}. {user_prompt}"
|
76 |
else:
|
77 |
-
prompt = f"Create a {age}-year-old person with {hair_color} hair, wearing {clothing}, showing a {facial_expression}. {user_prompt}"
|
78 |
|
79 |
# Call image generation API
|
80 |
with st.spinner("Generating the image..."):
|
|
|
66 |
with st.spinner("Analyzing the image..."):
|
67 |
gender = query_analysis(image_bytes, "What is the gender of the person in the image?")
|
68 |
clothing = query_analysis(image_bytes, "What is the person wearing and which color?")
|
69 |
+
hair_color = query_analysis(image_bytes, "What is the hair color and hair style of the person?")
|
70 |
+
facial_expression = query_analysis(image_bytes, "What is the facial expression and facial features of the person?")
|
71 |
age = query_analysis(image_bytes, "What is the estimated age of the person?")
|
72 |
|
73 |
# Build generation prompt based on VQA responses and user input
|
74 |
if gender.lower() == "female":
|
75 |
+
prompt = f"Create a full image from head to foot and close to realistic image of {age}-year-old girl with {hair_color} hair, wearing {clothing}, showing a {facial_expression}. {user_prompt}"
|
76 |
else:
|
77 |
+
prompt = f"Create a full image from head to foot and close to realistic image of {age}-year-old person with {hair_color} hair, wearing {clothing}, showing a {facial_expression}. {user_prompt}"
|
78 |
|
79 |
# Call image generation API
|
80 |
with st.spinner("Generating the image..."):
|