jamino30 commited on
Commit
5c261c3
1 Parent(s): 662e0b6

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +14 -18
app.py CHANGED
@@ -131,19 +131,6 @@ def inference(content_image, style_image, style_strength, progress=gr.Progress(t
131
  yield save_img(generated_img, original_size)
132
 
133
 
134
- examples = [
135
- # page 1
136
- ['./content_images/TajMahal.jpg', 'Starry Night', 75],
137
- ['./content_images/GoldenRetriever.jpg', 'Lego Bricks', 50],
138
- ['./content_images/Beach.jpg', 'Oil Painting', 50],
139
- ['./content_images/StandingOnCliff.png', 'Great Wave', 75],
140
- # page 2
141
- ['./content_images/Surfer.jpg', 'Starry Night', 75],
142
- ['./content_images/CameraGirl.jpg', 'Lego Bricks', 50],
143
- ['./content_images/NYCSkyline.jpg', 'Oil Painting', 50],
144
- ['./content_images/GoldenRetriever.jpg', 'Great Wave', 75],
145
- ]
146
-
147
  with gr.Blocks(title='🖼️ Neural Style Transfer') as demo:
148
  gr.HTML("<h1 style='text-align: center'>🖼️ Neural Style Transfer</h1>")
149
  with gr.Row():
@@ -158,13 +145,22 @@ with gr.Blocks(title='🖼️ Neural Style Transfer') as demo:
158
 
159
  submit_button.click(fn=inference, inputs=[content_image, style_dropdown, style_strength], outputs=[output_image])
160
 
161
- gr.Examples(
162
- fn=inference,
163
- examples=examples,
 
 
 
 
 
 
 
 
 
 
164
  inputs=[content_image, style_dropdown, style_strength],
165
- outputs=[output_image],
166
  examples_per_page=len(style_options),
167
  cache_examples='lazy',
168
  )
169
 
170
- demo.launch(inbrowser=True, show_api=True)
 
131
  yield save_img(generated_img, original_size)
132
 
133
 
 
 
 
 
 
 
 
 
 
 
 
 
 
134
  with gr.Blocks(title='🖼️ Neural Style Transfer') as demo:
135
  gr.HTML("<h1 style='text-align: center'>🖼️ Neural Style Transfer</h1>")
136
  with gr.Row():
 
145
 
146
  submit_button.click(fn=inference, inputs=[content_image, style_dropdown, style_strength], outputs=[output_image])
147
 
148
+ examples = gr.Examples(
149
+ examples=[
150
+ # page 1
151
+ ['./content_images/TajMahal.jpg', 'Starry Night', 75],
152
+ ['./content_images/GoldenRetriever.jpg', 'Lego Bricks', 50],
153
+ ['./content_images/Beach.jpg', 'Oil Painting', 50],
154
+ ['./content_images/StandingOnCliff.png', 'Great Wave', 75],
155
+ # page 2
156
+ ['./content_images/Surfer.jpg', 'Starry Night', 75],
157
+ ['./content_images/CameraGirl.jpg', 'Lego Bricks', 50],
158
+ ['./content_images/NYCSkyline.jpg', 'Oil Painting', 50],
159
+ ['./content_images/GoldenRetriever.jpg', 'Great Wave', 75],
160
+ ],
161
  inputs=[content_image, style_dropdown, style_strength],
 
162
  examples_per_page=len(style_options),
163
  cache_examples='lazy',
164
  )
165
 
166
+ demo.launch(show_api=True)