Michael Krasa commited on
Commit
cc03be5
·
1 Parent(s): 5e2e20e

updated to local images

Browse files
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 for the interface
49
  example_images = [
50
- 'https://www.everwilde.com/media/0800/FLAYPLA-A-Tidy-Tips-Seeds.jpg',
51
- 'https://1.img-dpreview.com/files/p/TS560x560~forums/64454177/61cacd9b21b147a19a8a0927476a7d29',
52
- 'https://calscape.org/storage/app/species_images/calphotos/images/0000_0000_0515_1184.jpeg',
53
- 'https://vnps.org/wp-content/uploads/2021/05/Narrow-leaved-Blue-eyed-Grass-4-Sisyrinchium-angustifolium-by-Betsy-Washington.jpg',
54
- 'https://valleywaternews.org/wp-content/uploads/2016/06/ceanothus-clusters.jpg?w=1440',
55
- 'https://cdn11.bigcommerce.com/s-1b9100svju/images/stencil/1280x1280/products/2044/1440/DETA-635__75522.1664817787.jpg?c=1'
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