Michael Krasa
commited on
Commit
·
cc03be5
1
Parent(s):
5e2e20e
updated to local images
Browse files- app.py +9 -8
- example_images/example_1.jpg +0 -0
- example_images/example_2.jpg +0 -0
- example_images/example_3.jpg +0 -0
- example_images/example_4.jpg +0 -0
- example_images/example_5.jpg +0 -0
- example_images/example_6.jpg +0 -0
app.py
CHANGED
|
@@ -5,6 +5,7 @@ from PIL import Image
|
|
| 5 |
import io
|
| 6 |
import random
|
| 7 |
import requests
|
|
|
|
| 8 |
|
| 9 |
# Dictionary of plant names and their Wikipedia links
|
| 10 |
search_terms_wikipedia = {
|
|
@@ -45,14 +46,14 @@ prompt_templates = [
|
|
| 45 |
"A whimsical mixed-media scene of a {flower} garden at sunrise, combining loose watercolor washes with detailed botanical illustrations, featuring hidden wildlife and morning fog rolling through the valley."
|
| 46 |
]
|
| 47 |
|
| 48 |
-
# Example images
|
| 49 |
example_images = [
|
| 50 |
-
'
|
| 51 |
-
'
|
| 52 |
-
'
|
| 53 |
-
'
|
| 54 |
-
'
|
| 55 |
-
'
|
| 56 |
]
|
| 57 |
|
| 58 |
# Function to handle AI generation progress updates
|
|
@@ -112,7 +113,7 @@ with gr.Blocks() as demo:
|
|
| 112 |
wiki_output = gr.Textbox(label="Wikipedia Article Link", lines=1)
|
| 113 |
generated_image = gr.Image(label="AI Generated Interpretation")
|
| 114 |
|
| 115 |
-
# Add example images
|
| 116 |
gr.Examples(
|
| 117 |
examples=example_images,
|
| 118 |
inputs=input_image,
|
|
|
|
| 5 |
import io
|
| 6 |
import random
|
| 7 |
import requests
|
| 8 |
+
from pathlib import Path
|
| 9 |
|
| 10 |
# Dictionary of plant names and their Wikipedia links
|
| 11 |
search_terms_wikipedia = {
|
|
|
|
| 46 |
"A whimsical mixed-media scene of a {flower} garden at sunrise, combining loose watercolor washes with detailed botanical illustrations, featuring hidden wildlife and morning fog rolling through the valley."
|
| 47 |
]
|
| 48 |
|
| 49 |
+
# Example images (using local paths)
|
| 50 |
example_images = [
|
| 51 |
+
str(Path('example_images/example_1.jpg')),
|
| 52 |
+
str(Path('example_images/example_2.jpg')),
|
| 53 |
+
str(Path('example_images/example_3.jpg')),
|
| 54 |
+
str(Path('example_images/example_4.jpg')),
|
| 55 |
+
str(Path('example_images/example_5.jpg')),
|
| 56 |
+
str(Path('example_images/example_6.jpg'))
|
| 57 |
]
|
| 58 |
|
| 59 |
# Function to handle AI generation progress updates
|
|
|
|
| 113 |
wiki_output = gr.Textbox(label="Wikipedia Article Link", lines=1)
|
| 114 |
generated_image = gr.Image(label="AI Generated Interpretation")
|
| 115 |
|
| 116 |
+
# Add example images using local paths
|
| 117 |
gr.Examples(
|
| 118 |
examples=example_images,
|
| 119 |
inputs=input_image,
|
example_images/example_1.jpg
ADDED
|
example_images/example_2.jpg
ADDED
|
example_images/example_3.jpg
ADDED
|
example_images/example_4.jpg
ADDED
|
example_images/example_5.jpg
ADDED
|
example_images/example_6.jpg
ADDED
|