Spaces:
Runtime error
Runtime error
defaults
Browse files- app.py +26 -0
- cat_agility.jpg +0 -0
- square_ims/american_gothic.jpg +0 -0
- square_ims/colloseum.jpg +0 -0
- square_ims/hf.png +0 -0
- square_ims/imagenet_cake_2.jpg +0 -0
- square_ims/imagenet_dog_1.jpg +0 -0
- square_ims/imagenet_dog_2.jpg +0 -0
- square_ims/scream.jpg +0 -0
- square_ims/ucsb.jpg +0 -0
- square_ims/yosemite.jpg +0 -0
app.py
CHANGED
@@ -66,6 +66,31 @@ def edict(x, source_text, edit_text,
|
|
66 |
# x = decode_image(response)
|
67 |
# return np.array(x)
|
68 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
iface = gr.Interface(fn=edict, inputs=["image",
|
70 |
gr.Textbox(label="Original Description"),
|
71 |
gr.Textbox(label="Edit Description"),
|
@@ -74,5 +99,6 @@ iface = gr.Interface(fn=edict, inputs=["image",
|
|
74 |
gr.Slider(0.0, 1, value=0.8, step=0.05),
|
75 |
gr.Slider(0, 10, value=3, step=0.5),
|
76 |
],
|
|
|
77 |
outputs="image")
|
78 |
iface.launch()
|
|
|
66 |
# x = decode_image(response)
|
67 |
# return np.array(x)
|
68 |
|
69 |
+
examples =
|
70 |
+
[
|
71 |
+
['square_ims/american_gothic.jpg', 'A painting of two people frowning', 'A painting of two people smiling', 0.5, 3],
|
72 |
+
['square_ims/colloseum.jpg', 'An old ruined building', 'A new modern office building', 0.8, 3],
|
73 |
+
['square_ims/hf.png', 'Emoji', 'Emoji with a mustache', 0.8, 3],
|
74 |
+
]
|
75 |
+
|
76 |
+
for dog_i in [1, 2]:
|
77 |
+
for breed in ['Golden Retriever', 'Chihuahua', 'Dalmatian']:
|
78 |
+
examples.append([f'square_ims/imagenet_dog_{dog_i}.jpg', 'A dog', f'A {breed}', 0.8, 3])
|
79 |
+
|
80 |
+
examples.append(['square_ims/scream.jpg', 'A painting of someone screaming', 'A painting of an alien', 0.5, 3])
|
81 |
+
examples.append('square_ims/yosemite.jpg', 'Granite forest valley', 'Granite desert valley', 0.8, 3])
|
82 |
+
examples.append('square_ims/einstein.jpg', 'Mouth open', 'Mouth closed', 0.8, 3])
|
83 |
+
examples.append('square_ims/einstein.jpg', 'A man', 'A man in K.I.S.S. facepaint', 0.8, 3])
|
84 |
+
examples.extend([
|
85 |
+
['square_ims/imagenet_cake_2.jpg', 'A cupcake', 'A Chinese New Year cupcake', 0.8, 3],
|
86 |
+
['square_ims/imagenet_cake_2.jpg', 'A cupcake', 'A Union Jack cupcake', 0.8, 3],
|
87 |
+
['square_ims/imagenet_cake_2.jpg', 'A cupcake', 'A Nigerian flag cupcake', 0.8, 3],
|
88 |
+
['square_ims/imagenet_cake_2.jpg', 'A cupcake', 'A Santa Claus cupcake', 0.8, 3],
|
89 |
+
['square_ims/imagenet_cake_2.jpg', 'A cupcake', 'An Easter cupcake', 0.8, 3],
|
90 |
+
['square_ims/imagenet_cake_2.jpg', 'A cupcake', 'A hedgehog cupcake', 0.8, 3],
|
91 |
+
['square_ims/imagenet_cake_2.jpg', 'A cupcake', 'A rose cupcake', 0.8, 3],
|
92 |
+
])
|
93 |
+
|
94 |
iface = gr.Interface(fn=edict, inputs=["image",
|
95 |
gr.Textbox(label="Original Description"),
|
96 |
gr.Textbox(label="Edit Description"),
|
|
|
99 |
gr.Slider(0.0, 1, value=0.8, step=0.05),
|
100 |
gr.Slider(0, 10, value=3, step=0.5),
|
101 |
],
|
102 |
+
examples = examples,
|
103 |
outputs="image")
|
104 |
iface.launch()
|
cat_agility.jpg
DELETED
Binary file (57.8 kB)
|
|
square_ims/american_gothic.jpg
ADDED
square_ims/colloseum.jpg
ADDED
square_ims/hf.png
ADDED
square_ims/imagenet_cake_2.jpg
ADDED
square_ims/imagenet_dog_1.jpg
ADDED
square_ims/imagenet_dog_2.jpg
ADDED
square_ims/scream.jpg
ADDED
square_ims/ucsb.jpg
ADDED
square_ims/yosemite.jpg
ADDED