Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -32,16 +32,9 @@ def get_mood_from_image(image: Image.Image):
|
|
32 |
for mood, score in zip(moods, probs[0]):
|
33 |
mood_scores[mood] = score
|
34 |
print("Mood Scores:", mood_scores)
|
35 |
-
|
36 |
-
|
37 |
-
# Filter moods with a score above 60%
|
38 |
-
filtered_moods = {k: v for k, v in mood_scores.items() if v > 0.4}
|
39 |
-
|
40 |
-
if len(filtered_moods) < 2:
|
41 |
-
return None
|
42 |
-
|
43 |
# Select the mood with the highest score
|
44 |
-
selected_mood = max(
|
|
|
45 |
return selected_mood
|
46 |
def generate_art(mood):
|
47 |
# Implement art generation logic using the Stable Diffusion API
|
|
|
32 |
for mood, score in zip(moods, probs[0]):
|
33 |
mood_scores[mood] = score
|
34 |
print("Mood Scores:", mood_scores)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
# Select the mood with the highest score
|
36 |
+
selected_mood = max(mood_scores, key=mood_scores.get)
|
37 |
+
|
38 |
return selected_mood
|
39 |
def generate_art(mood):
|
40 |
# Implement art generation logic using the Stable Diffusion API
|