Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -140,97 +140,101 @@ def main():
|
|
| 140 |
with st.sidebar.expander("Advanced use"):
|
| 141 |
st.markdown(howto)
|
| 142 |
|
| 143 |
-
|
| 144 |
-
'a bad photo of a {}.',
|
| 145 |
-
'a photo of many {}.',
|
| 146 |
-
'a sculpture of a {}.',
|
| 147 |
-
'a photo of the hard to see {}.',
|
| 148 |
-
'a low resolution photo of the {}.',
|
| 149 |
-
'a rendering of a {}.',
|
| 150 |
-
'graffiti of a {}.',
|
| 151 |
-
'a bad photo of the {}.',
|
| 152 |
-
'a cropped photo of the {}.',
|
| 153 |
-
'a tattoo of a {}.',
|
| 154 |
-
'the embroidered {}.',
|
| 155 |
-
'a photo of a hard to see {}.',
|
| 156 |
-
'a bright photo of a {}.',
|
| 157 |
-
'a photo of a clean {}.',
|
| 158 |
-
'a photo of a dirty {}.',
|
| 159 |
-
'a dark photo of the {}.',
|
| 160 |
-
'a drawing of a {}.',
|
| 161 |
-
'a photo of my {}.',
|
| 162 |
-
'the plastic {}.',
|
| 163 |
-
'a photo of the cool {}.',
|
| 164 |
-
'a close-up photo of a {}.',
|
| 165 |
-
'a black and white photo of the {}.',
|
| 166 |
-
'a painting of the {}.',
|
| 167 |
-
'a painting of a {}.',
|
| 168 |
-
'a pixelated photo of the {}.',
|
| 169 |
-
'a sculpture of the {}.',
|
| 170 |
-
'a bright photo of the {}.',
|
| 171 |
-
'a cropped photo of a {}.',
|
| 172 |
-
'a plastic {}.',
|
| 173 |
-
'a photo of the dirty {}.',
|
| 174 |
-
'a jpeg corrupted photo of a {}.',
|
| 175 |
-
'a blurry photo of the {}.',
|
| 176 |
-
'a photo of the {}.',
|
| 177 |
-
'a good photo of the {}.',
|
| 178 |
-
'a rendering of the {}.',
|
| 179 |
-
'a {} in a video game.',
|
| 180 |
-
'a photo of one {}.',
|
| 181 |
-
'a doodle of a {}.',
|
| 182 |
-
'a close-up photo of the {}.',
|
| 183 |
-
'a photo of a {}.',
|
| 184 |
-
'the origami {}.',
|
| 185 |
-
'the {} in a video game.',
|
| 186 |
-
'a sketch of a {}.',
|
| 187 |
-
'a doodle of the {}.',
|
| 188 |
-
'a origami {}.',
|
| 189 |
-
'a low resolution photo of a {}.',
|
| 190 |
-
'the toy {}.',
|
| 191 |
-
'a rendition of the {}.',
|
| 192 |
-
'a photo of the clean {}.',
|
| 193 |
-
'a photo of a large {}.',
|
| 194 |
-
'a rendition of a {}.',
|
| 195 |
-
'a photo of a nice {}.',
|
| 196 |
-
'a photo of a weird {}.',
|
| 197 |
-
'a blurry photo of a {}.',
|
| 198 |
-
'a cartoon {}.',
|
| 199 |
-
'art of a {}.',
|
| 200 |
-
'a sketch of the {}.',
|
| 201 |
-
'a embroidered {}.',
|
| 202 |
-
'a pixelated photo of a {}.',
|
| 203 |
-
'itap of the {}.',
|
| 204 |
-
'a jpeg corrupted photo of the {}.',
|
| 205 |
-
'a good photo of a {}.',
|
| 206 |
-
'a plushie {}.',
|
| 207 |
-
'a photo of the nice {}.',
|
| 208 |
-
'a photo of the small {}.',
|
| 209 |
-
'a photo of the weird {}.',
|
| 210 |
-
'the cartoon {}.',
|
| 211 |
-
'art of the {}.',
|
| 212 |
-
'a drawing of the {}.',
|
| 213 |
-
'a photo of the large {}.',
|
| 214 |
-
'a black and white photo of a {}.',
|
| 215 |
-
'the plushie {}.',
|
| 216 |
-
'a dark photo of a {}.',
|
| 217 |
-
'itap of a {}.',
|
| 218 |
-
'graffiti of the {}.',
|
| 219 |
-
'a toy {}.',
|
| 220 |
-
'itap of my {}.',
|
| 221 |
-
'a photo of a cool {}.',
|
| 222 |
-
'a photo of a small {}.',
|
| 223 |
-
'a tattoo of the {}.',
|
| 224 |
-
]
|
| 225 |
|
| 226 |
st.sidebar.markdown(f"Unsplash has categories that match: backgrounds, photos, nature, iphone, etc")
|
| 227 |
st.sidebar.markdown(f"Unsplash images contain animals, apps, events, feelings, food, travel, nature, people, religion, sports, things, stock")
|
| 228 |
st.sidebar.markdown(f"Unsplash things include flag, tree, clock, money, tattoo, arrow, book, car, fireworks, ghost, health, kiss, dance, balloon, crown, eye, house, music, airplane, lighthouse, typewriter, toys")
|
| 229 |
st.sidebar.markdown(f"unsplash feelings include funny, heart, love, cool, congratulations, love, scary, cute, friendship, inspirational, hug, sad, cursed, beautiful, crazy, respect, transformation, peaceful, happy")
|
| 230 |
st.sidebar.markdown(f"unsplash people contain baby, life, women, family, girls, pregnancy, society, old people, musician, attractive, bohemian")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 231 |
|
| 232 |
#print(f"{len(imagenet_classes)} classes, {len(imagenet_templates)} templates")
|
| 233 |
-
st.sidebar.markdown(
|
| 234 |
|
| 235 |
|
| 236 |
_, c, _ = st.columns((1, 3, 1))
|
|
|
|
| 140 |
with st.sidebar.expander("Advanced use"):
|
| 141 |
st.markdown(howto)
|
| 142 |
|
| 143 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 144 |
|
| 145 |
st.sidebar.markdown(f"Unsplash has categories that match: backgrounds, photos, nature, iphone, etc")
|
| 146 |
st.sidebar.markdown(f"Unsplash images contain animals, apps, events, feelings, food, travel, nature, people, religion, sports, things, stock")
|
| 147 |
st.sidebar.markdown(f"Unsplash things include flag, tree, clock, money, tattoo, arrow, book, car, fireworks, ghost, health, kiss, dance, balloon, crown, eye, house, music, airplane, lighthouse, typewriter, toys")
|
| 148 |
st.sidebar.markdown(f"unsplash feelings include funny, heart, love, cool, congratulations, love, scary, cute, friendship, inspirational, hug, sad, cursed, beautiful, crazy, respect, transformation, peaceful, happy")
|
| 149 |
st.sidebar.markdown(f"unsplash people contain baby, life, women, family, girls, pregnancy, society, old people, musician, attractive, bohemian")
|
| 150 |
+
|
| 151 |
+
imagenetquerytips="
|
| 152 |
+
a bad photo of a {}.,
|
| 153 |
+
a photo of many {}.,
|
| 154 |
+
a sculpture of a {}.,
|
| 155 |
+
a photo of the hard to see {}.,
|
| 156 |
+
a low resolution photo of the {}.,
|
| 157 |
+
a rendering of a {}.,
|
| 158 |
+
graffiti of a {}.,
|
| 159 |
+
a bad photo of the {}.,
|
| 160 |
+
a cropped photo of the {}.,
|
| 161 |
+
a tattoo of a {}.,
|
| 162 |
+
the embroidered {}.,
|
| 163 |
+
a photo of a hard to see {}.,
|
| 164 |
+
a bright photo of a {}.,
|
| 165 |
+
a photo of a clean {}.,
|
| 166 |
+
a photo of a dirty {}.,
|
| 167 |
+
a dark photo of the {}.,
|
| 168 |
+
a drawing of a {}.,
|
| 169 |
+
a photo of my {}.,
|
| 170 |
+
the plastic {}.,
|
| 171 |
+
a photo of the cool {}.,
|
| 172 |
+
a close-up photo of a {}.,
|
| 173 |
+
a black and white photo of the {}.,
|
| 174 |
+
a painting of the {}.,
|
| 175 |
+
a painting of a {}.,
|
| 176 |
+
a pixelated photo of the {}.,
|
| 177 |
+
a sculpture of the {}.,
|
| 178 |
+
a bright photo of the {}.,
|
| 179 |
+
a cropped photo of a {}.,
|
| 180 |
+
a plastic {}.,
|
| 181 |
+
a photo of the dirty {}.,
|
| 182 |
+
a jpeg corrupted photo of a {}.,
|
| 183 |
+
a blurry photo of the {}.,
|
| 184 |
+
a photo of the {}.,
|
| 185 |
+
a good photo of the {}.,
|
| 186 |
+
a rendering of the {}.,
|
| 187 |
+
a {} in a video game.,
|
| 188 |
+
a photo of one {}.,
|
| 189 |
+
a doodle of a {}.,
|
| 190 |
+
a close-up photo of the {}.,
|
| 191 |
+
a photo of a {}.,
|
| 192 |
+
the origami {}.,
|
| 193 |
+
the {} in a video game.,
|
| 194 |
+
a sketch of a {}.,
|
| 195 |
+
a doodle of the {}.,
|
| 196 |
+
a origami {}.,
|
| 197 |
+
a low resolution photo of a {}.,
|
| 198 |
+
the toy {}.,
|
| 199 |
+
a rendition of the {}.,
|
| 200 |
+
a photo of the clean {}.,
|
| 201 |
+
a photo of a large {}.,
|
| 202 |
+
a rendition of a {}.,
|
| 203 |
+
a photo of a nice {}.,
|
| 204 |
+
a photo of a weird {}.,
|
| 205 |
+
a blurry photo of a {}.,
|
| 206 |
+
a cartoon {}.,
|
| 207 |
+
art of a {}.,
|
| 208 |
+
a sketch of the {}.,
|
| 209 |
+
a embroidered {}.,
|
| 210 |
+
a pixelated photo of a {}.,
|
| 211 |
+
itap of the {}.,
|
| 212 |
+
a jpeg corrupted photo of the {}.,
|
| 213 |
+
a good photo of a {}.,
|
| 214 |
+
a plushie {}.,
|
| 215 |
+
a photo of the nice {}.,
|
| 216 |
+
a photo of the small {}.,
|
| 217 |
+
a photo of the weird {}.,
|
| 218 |
+
the cartoon {}.,
|
| 219 |
+
art of the {}.,
|
| 220 |
+
a drawing of the {}.,
|
| 221 |
+
a photo of the large {}.,
|
| 222 |
+
a black and white photo of a {}.,
|
| 223 |
+
the plushie {}.,
|
| 224 |
+
a dark photo of a {}.,
|
| 225 |
+
itap of a {}.,
|
| 226 |
+
graffiti of the {}.,
|
| 227 |
+
a toy {}.,
|
| 228 |
+
itap of my {}.,
|
| 229 |
+
a photo of a cool {}.,
|
| 230 |
+
a photo of a small {}.,
|
| 231 |
+
a tattoo of the {}.,
|
| 232 |
+
"
|
| 233 |
+
|
| 234 |
+
|
| 235 |
|
| 236 |
#print(f"{len(imagenet_classes)} classes, {len(imagenet_templates)} templates")
|
| 237 |
+
st.sidebar.markdown(imagenetquerytips)
|
| 238 |
|
| 239 |
|
| 240 |
_, c, _ = st.columns((1, 3, 1))
|