Spaces:
Sleeping
Sleeping
move details to bottom
Browse files
app.py
CHANGED
@@ -14,7 +14,22 @@ with demo:
|
|
14 |
"""
|
15 |
# 🌍 Map Diffuser
|
16 |
|
|
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
### Generates images from a given text prompt. The prompts are in the format:
|
19 |
|
20 |
- `{style} map of {city} with {features}` or
|
@@ -40,15 +55,8 @@ with demo:
|
|
40 |
| Watercolor style map of Amsterdam with residential area and highways | <img src="https://www.evernote.com/shard/s542/sh/a22970f5-552f-4872-b738-667e64b28be4/ecjvm3GJBekvShqyebx8RQYH1ZTP4WrZzSqhB5lt6kv5jUjgKH0l7b57KA/deep/0/image.png" width="100" /> |
|
41 |
| Toner style map of Amsterdam with residential area and highways | <img src="https://www.evernote.com/shard/s542/sh/1dfce0dc-8d63-4a83-b590-979ad038198f/1N9mAOsR0GddsULJaAMB8dYU9eR1-McyUXtgOmVFQ4UbX0rwbNfkylI1iQ/deep/0/image.png" width="100" /> |
|
42 |
| Satellite image with forests and residential, no water | <img src="https://www.evernote.com/shard/s542/sh/2c532cf5-e73b-410e-8433-439466211306/Fh8SsltsWRCW_bLGmrj_TfV2vfEwTUbDiUz_bMSn__0EuzmhdTK5F-C1og/deep/0/image.png" width="100" /> |
|
43 |
-
|
44 |
)
|
45 |
-
input = gr.components.Textbox(label="Enter a text prompt here")
|
46 |
-
output = gr.components.Image(label="Output Image")
|
47 |
-
# button to submit the prompt
|
48 |
-
button = gr.components.Button(label="Generate")
|
49 |
-
# when the button is clicked, call the generate_image_predictions function
|
50 |
-
# and pass in the prompt as an argument
|
51 |
-
button.click(generate_image_predictions, inputs=input, outputs=output)
|
52 |
|
53 |
|
54 |
demo.launch()
|
|
|
14 |
"""
|
15 |
# 🌍 Map Diffuser
|
16 |
|
17 |
+
Below we present a Stable Diffusion text to image model that will generate map tiles based on a text prompt. We trained it on just 10k images and prompts based on openstreetmap. Images were from @mapbox satellite images + @StamenDesign water color and toner images + @carto's Voyager style. The region trained was limited to central Europe and more precisely Prague and Amsterdam. This was part of the Hackathon run by Hugging Face & Google to use JAX API with Google Gen4 TPUs that are especially designed to train massive models.
|
18 |
|
19 |
+
|
20 |
+
The model tuning led to some surprising results. For example we didn't have any prompts with "ships" or "desert" yet when passed that it tried to add ships to the satellite images 🤷♂️...
|
21 |
+
"""
|
22 |
+
)
|
23 |
+
input = gr.components.Textbox(label="Enter a text prompt here")
|
24 |
+
output = gr.components.Image(label="Output Image")
|
25 |
+
# button to submit the prompt
|
26 |
+
button = gr.components.Button(label="Generate")
|
27 |
+
# when the button is clicked, call the generate_image_predictions function
|
28 |
+
# and pass in the prompt as an argument
|
29 |
+
button.click(generate_image_predictions, inputs=input, outputs=output)
|
30 |
+
|
31 |
+
gr.Markdown(
|
32 |
+
"""
|
33 |
### Generates images from a given text prompt. The prompts are in the format:
|
34 |
|
35 |
- `{style} map of {city} with {features}` or
|
|
|
55 |
| Watercolor style map of Amsterdam with residential area and highways | <img src="https://www.evernote.com/shard/s542/sh/a22970f5-552f-4872-b738-667e64b28be4/ecjvm3GJBekvShqyebx8RQYH1ZTP4WrZzSqhB5lt6kv5jUjgKH0l7b57KA/deep/0/image.png" width="100" /> |
|
56 |
| Toner style map of Amsterdam with residential area and highways | <img src="https://www.evernote.com/shard/s542/sh/1dfce0dc-8d63-4a83-b590-979ad038198f/1N9mAOsR0GddsULJaAMB8dYU9eR1-McyUXtgOmVFQ4UbX0rwbNfkylI1iQ/deep/0/image.png" width="100" /> |
|
57 |
| Satellite image with forests and residential, no water | <img src="https://www.evernote.com/shard/s542/sh/2c532cf5-e73b-410e-8433-439466211306/Fh8SsltsWRCW_bLGmrj_TfV2vfEwTUbDiUz_bMSn__0EuzmhdTK5F-C1og/deep/0/image.png" width="100" /> |
|
58 |
+
"""
|
59 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
|
61 |
|
62 |
demo.launch()
|