Spaces:
Running
Running
SatyamSinghal
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -81,6 +81,66 @@ def generate_scene_description(object_counts):
|
|
81 |
return "This scene could depict a garden or a floral setting, possibly involving gardening or photography."
|
82 |
elif "airplane" in object_counts:
|
83 |
return "This appears to capture an airport or an aerial view, featuring an airplane in flight or on the ground."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
else:
|
85 |
return "This scene involves various objects, indicating a dynamic or diverse setting."
|
86 |
# Create the Gradio interface with enhanced UI
|
|
|
81 |
return "This scene could depict a garden or a floral setting, possibly involving gardening or photography."
|
82 |
elif "airplane" in object_counts:
|
83 |
return "This appears to capture an airport or an aerial view, featuring an airplane in flight or on the ground."
|
84 |
+
elif "person" in object_counts and "whiteboard" in object_counts:
|
85 |
+
return "This could be a classroom or seminar setting, with individuals engaged in a lecture or discussion."
|
86 |
+
elif "person" in object_counts and "book" in object_counts:
|
87 |
+
return "This scene might depict a library or a study area, where individuals are reading or preparing for exams."
|
88 |
+
elif "person" in object_counts and "bicycle" in object_counts:
|
89 |
+
return "This is likely a college or urban area, with students or commuters cycling to their destinations."
|
90 |
+
elif "person" in object_counts and "water bottle" in object_counts:
|
91 |
+
return "This could be a casual setting, such as a study group or a break during classes, with hydration in focus."
|
92 |
+
elif "person" in object_counts and "notebook" in object_counts:
|
93 |
+
return "This scene might depict students taking notes during a lecture or brainstorming in a group study."
|
94 |
+
elif "person" in object_counts and "coffee cup" in object_counts:
|
95 |
+
return "This scene could represent a casual hangout in a café, study break, or an informal meeting."
|
96 |
+
elif "person" in object_counts and "calculator" in object_counts:
|
97 |
+
return "This is likely an exam hall or a math-focused study session, where calculations are being performed."
|
98 |
+
elif "laptop" in object_counts and "coffee cup" in object_counts:
|
99 |
+
return "This might depict a college café or a workspace where students are multitasking with work and refreshments."
|
100 |
+
elif "pen" in object_counts and "notebook" in object_counts:
|
101 |
+
return "This scene seems to involve note-taking or journaling, possibly in a classroom or a quiet study area."
|
102 |
+
elif "headphones" in object_counts and "person" in object_counts:
|
103 |
+
return "This is likely a casual setting where someone is listening to music, attending an online class, or watching videos."
|
104 |
+
|
105 |
+
# Other common and general scenarios
|
106 |
+
elif "person" in object_counts and "dog" in object_counts:
|
107 |
+
return "This scene seems to capture people spending time outdoors with pets, possibly in a park or recreational area."
|
108 |
+
elif "person" in object_counts and "laptop" in object_counts:
|
109 |
+
return "This might be a workplace or a study environment, featuring individuals using laptops for work or study."
|
110 |
+
elif "car" in object_counts or "truck" in object_counts:
|
111 |
+
return "This appears to be a street or traffic scene with vehicles in motion or parked."
|
112 |
+
elif "cat" in object_counts and "sofa" in object_counts:
|
113 |
+
return "This scene seems to capture a cozy indoor environment, likely a home with pets relaxing."
|
114 |
+
elif "bicycle" in object_counts and "person" in object_counts:
|
115 |
+
return "This could depict an outdoor activity, such as cycling or commuting by bike."
|
116 |
+
elif "boat" in object_counts or "ship" in object_counts:
|
117 |
+
return "This seems to be a water-based setting, possibly near a harbor, river, or open sea."
|
118 |
+
elif "bird" in object_counts and "tree" in object_counts:
|
119 |
+
return "This scene depicts a natural setting, possibly a park or forest, with birds and trees."
|
120 |
+
elif "person" in object_counts and "microwave" in object_counts:
|
121 |
+
return "This is likely an indoor setting, such as a kitchen, where cooking or meal preparation is taking place."
|
122 |
+
elif "cow" in object_counts or "sheep" in object_counts:
|
123 |
+
return "This scene appears to capture a rural or farming environment, featuring livestock in open fields or farms."
|
124 |
+
elif "horse" in object_counts and "person" in object_counts:
|
125 |
+
return "This might depict an equestrian scene, possibly involving horseback riding or ranch activities."
|
126 |
+
elif "dog" in object_counts and "ball" in object_counts:
|
127 |
+
return "This scene seems to show playful activities, possibly a game of fetch with a dog."
|
128 |
+
elif "umbrella" in object_counts and "person" in object_counts:
|
129 |
+
return "This might capture a rainy day or a sunny outdoor activity where umbrellas are being used."
|
130 |
+
elif "train" in object_counts or "railway" in object_counts:
|
131 |
+
return "This scene could involve a railway station or a train passing through a scenic route."
|
132 |
+
elif "surfboard" in object_counts or "person" in object_counts:
|
133 |
+
return "This is likely a beach or coastal scene featuring activities like surfing or water sports."
|
134 |
+
elif "book" in object_counts and "person" in object_counts:
|
135 |
+
return "This scene could depict a quiet reading environment, such as a library or a study room."
|
136 |
+
elif "traffic light" in object_counts and "car" in object_counts:
|
137 |
+
return "This seems to capture an urban street scene with traffic and signals controlling the flow."
|
138 |
+
elif "chair" in object_counts and "dining table" in object_counts:
|
139 |
+
return "This is likely an indoor dining area, possibly a family meal or a restaurant setting."
|
140 |
+
elif "flower" in object_counts and "person" in object_counts:
|
141 |
+
return "This scene could depict a garden or a floral setting, possibly involving gardening or photography."
|
142 |
+
elif "airplane" in object_counts:
|
143 |
+
return "This appears to capture an airport or an aerial view, featuring an airplane in flight or on the ground."
|
144 |
else:
|
145 |
return "This scene involves various objects, indicating a dynamic or diverse setting."
|
146 |
# Create the Gradio interface with enhanced UI
|