Update app.py
Browse files
app.py
CHANGED
|
@@ -3,6 +3,7 @@ from PIL import Image
|
|
| 3 |
import os
|
| 4 |
import random
|
| 5 |
import glob
|
|
|
|
| 6 |
|
| 7 |
def generate_image(text, input_image):
|
| 8 |
return input_image
|
|
@@ -15,7 +16,7 @@ article = """
|
|
| 15 |
|
| 16 |
def images(text, input_image, pictures):
|
| 17 |
if input_image:
|
| 18 |
-
return [
|
| 19 |
|
| 20 |
# Gradio
|
| 21 |
with gr.Blocks(theme=gr.themes.Default(primary_hue=gr.themes.colors.blue, secondary_hue=gr.themes.colors.orange)) as demo:
|
|
@@ -40,9 +41,6 @@ with gr.Blocks(theme=gr.themes.Default(primary_hue=gr.themes.colors.blue, second
|
|
| 40 |
# generate
|
| 41 |
generate_button = gr.Button("Найти", variant='primary')
|
| 42 |
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
with gr.Column():
|
| 47 |
# output image
|
| 48 |
# add gallery of 20 pictures here
|
|
|
|
| 3 |
import os
|
| 4 |
import random
|
| 5 |
import glob
|
| 6 |
+
from datasets import load_dataset
|
| 7 |
|
| 8 |
def generate_image(text, input_image):
|
| 9 |
return input_image
|
|
|
|
| 16 |
|
| 17 |
def images(text, input_image, pictures):
|
| 18 |
if input_image:
|
| 19 |
+
return [load_dataset("DoomAI/doomai", data_files="Accordion/001e9bee1924c738.jpg")["train"]["image"]] * pictures
|
| 20 |
|
| 21 |
# Gradio
|
| 22 |
with gr.Blocks(theme=gr.themes.Default(primary_hue=gr.themes.colors.blue, secondary_hue=gr.themes.colors.orange)) as demo:
|
|
|
|
| 41 |
# generate
|
| 42 |
generate_button = gr.Button("Найти", variant='primary')
|
| 43 |
|
|
|
|
|
|
|
|
|
|
| 44 |
with gr.Column():
|
| 45 |
# output image
|
| 46 |
# add gallery of 20 pictures here
|