Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -47,13 +47,13 @@ def generate_design_ideas(comfort, social_interaction, stressors, privacy, open_
|
|
47 |
f"{system_message}\n"
|
48 |
f"On a scale of 1-5, with 5 being the most favorable and 1 being the least ideal, {alias} rated the following:\n"
|
49 |
f"Comfort and Well-being: {comfort}\n"
|
50 |
-
f"
|
51 |
-
f"
|
52 |
-
f"
|
53 |
f"Open-ended Question: {open_question}\n"
|
54 |
f"Detected Image Theme: {image_info['Detected Theme']}\n"
|
55 |
f"Confidence Score: {image_info['Confidence Score']}\n"
|
56 |
-
f"Please provide innovative environmental psychology design ideas to improve climate and curb climate change, addressing
|
57 |
)
|
58 |
|
59 |
# Generate design ideas using the Hugging Face model
|
@@ -100,7 +100,7 @@ def analyze_environmental_design(comfort, social_interaction, stressors, privacy
|
|
100 |
|
101 |
return fig, design_ideas
|
102 |
|
103 |
-
# Custom CSS for modern design
|
104 |
custom_css = """
|
105 |
body {
|
106 |
font-family: 'Arial', sans-serif;
|
@@ -135,18 +135,25 @@ body {
|
|
135 |
.gradio-button:hover {
|
136 |
background-color: #004d40;
|
137 |
}
|
|
|
|
|
|
|
|
|
|
|
138 |
"""
|
|
|
139 |
# Disclaimer text to include in the description
|
140 |
disclaimer_text = """
|
141 |
**Disclaimer**:
|
142 |
1. This solution was built in only 5 hours with a limited dataset during the training of the CNN, so it may have some biases.
|
143 |
2. The solution is running on low compute resources, so we recommend using it when there is low traffic to improve performance.
|
144 |
"""
|
|
|
145 |
# Create the Gradio interface with custom CSS
|
146 |
inputs = [
|
147 |
gr.Slider(minimum=1, maximum=5, step=1, label="On a scale of 1-5, with 5 being the most favorable and 1 being the least ideal. How would you rate your feelings of Comfort and Well-being?"),
|
148 |
gr.Slider(minimum=1, maximum=5, step=1, label="On a scale of 1-5, with 5 being the most favorable and 1 being the least ideal. How would you rate the quality of your Social Interaction?"),
|
149 |
-
gr.Slider(minimum=1, maximum=5, step=1, label="On a scale of 1-5, with 5 being the most favorable and 1 being the least ideal. How would you rate
|
150 |
gr.Slider(minimum=1, maximum=5, step=1, label="On a scale of 1-5, with 5 being the most favorable and 1 being the least ideal. How would you rate the quality of your Personal Spaces?"),
|
151 |
gr.Textbox(placeholder="Describe any environmental challenges or ideas you have.", label="Open-ended Question", lines=3),
|
152 |
gr.Textbox(placeholder="Enter your alias (e.g., anon).", label="Client Alias", lines=1), # New input for alias
|
@@ -163,6 +170,6 @@ gr.Interface(
|
|
163 |
inputs=inputs,
|
164 |
outputs=outputs,
|
165 |
title="MAZINGIRA 254: Climate-Smart Environmental Psychology Design Ideas",
|
166 |
-
description="Input your environmental concerns and ideas in form of images and personal experiences to receive creative design recommendations and a visual assessment of climate change impact
|
167 |
css=custom_css # Apply custom CSS
|
168 |
).launch()
|
|
|
47 |
f"{system_message}\n"
|
48 |
f"On a scale of 1-5, with 5 being the most favorable and 1 being the least ideal, {alias} rated the following:\n"
|
49 |
f"Comfort and Well-being: {comfort}\n"
|
50 |
+
f"Quality of Social Interaction: {social_interaction}\n"
|
51 |
+
f"Absence of overwhelming Environmental Stressors: {stressors}\n"
|
52 |
+
f"Quality of Personal Spaces: {privacy}\n"
|
53 |
f"Open-ended Question: {open_question}\n"
|
54 |
f"Detected Image Theme: {image_info['Detected Theme']}\n"
|
55 |
f"Confidence Score: {image_info['Confidence Score']}\n"
|
56 |
+
f"Please provide innovative environmental psychology design ideas to improve climate and curb climate change, addressing wellness and sustainability for {alias} directly."
|
57 |
)
|
58 |
|
59 |
# Generate design ideas using the Hugging Face model
|
|
|
100 |
|
101 |
return fig, design_ideas
|
102 |
|
103 |
+
# Custom CSS for modern design with footer hidden
|
104 |
custom_css = """
|
105 |
body {
|
106 |
font-family: 'Arial', sans-serif;
|
|
|
135 |
.gradio-button:hover {
|
136 |
background-color: #004d40;
|
137 |
}
|
138 |
+
|
139 |
+
/* Hide Gradio footer */
|
140 |
+
footer {
|
141 |
+
display: none !important;
|
142 |
+
}
|
143 |
"""
|
144 |
+
|
145 |
# Disclaimer text to include in the description
|
146 |
disclaimer_text = """
|
147 |
**Disclaimer**:
|
148 |
1. This solution was built in only 5 hours with a limited dataset during the training of the CNN, so it may have some biases.
|
149 |
2. The solution is running on low compute resources, so we recommend using it when there is low traffic to improve performance.
|
150 |
"""
|
151 |
+
|
152 |
# Create the Gradio interface with custom CSS
|
153 |
inputs = [
|
154 |
gr.Slider(minimum=1, maximum=5, step=1, label="On a scale of 1-5, with 5 being the most favorable and 1 being the least ideal. How would you rate your feelings of Comfort and Well-being?"),
|
155 |
gr.Slider(minimum=1, maximum=5, step=1, label="On a scale of 1-5, with 5 being the most favorable and 1 being the least ideal. How would you rate the quality of your Social Interaction?"),
|
156 |
+
gr.Slider(minimum=1, maximum=5, step=1, label="On a scale of 1-5, with 5 being the most favorable and 1 being the least ideal. How would you rate the absence of overwhelming Environmental Stressors like noise in your environment?"),
|
157 |
gr.Slider(minimum=1, maximum=5, step=1, label="On a scale of 1-5, with 5 being the most favorable and 1 being the least ideal. How would you rate the quality of your Personal Spaces?"),
|
158 |
gr.Textbox(placeholder="Describe any environmental challenges or ideas you have.", label="Open-ended Question", lines=3),
|
159 |
gr.Textbox(placeholder="Enter your alias (e.g., anon).", label="Client Alias", lines=1), # New input for alias
|
|
|
170 |
inputs=inputs,
|
171 |
outputs=outputs,
|
172 |
title="MAZINGIRA 254: Climate-Smart Environmental Psychology Design Ideas",
|
173 |
+
description=f"Input your environmental concerns and ideas in the form of images and personal experiences to receive creative design recommendations and a visual assessment of climate change impact.\n\n{disclaimer_text}",
|
174 |
css=custom_css # Apply custom CSS
|
175 |
).launch()
|