make example bigger / clearer
Browse files- .DS_Store +0 -0
- app.py +22 -24
- images/Donkey.jpg +0 -0
- Ray-Liotta-Goodfellas.jpg β images/Ray-Liotta-Goodfellas.jpg +0 -0
- images/Snoop Dogg.jpg +0 -0
- images/SohoJoeEth + Donkey.jpeg +0 -0
- SohoJoeEth + Ray.jpeg β images/SohoJoeEth + Ray.jpeg +0 -0
- images/SohoJoeEth + Snoop Dogg.jpeg +0 -0
- SohoJoeEth.jpeg β images/SohoJoeEth.jpeg +0 -0
- pup1.jpg β images/pup1.jpg +0 -0
- pup2.jpg β images/pup2.jpg +0 -0
- pup3.jpg β images/pup3.jpg +0 -0
- pup4.jpeg β images/pup4.jpeg +0 -0
- pup5.jpg β images/pup5.jpg +0 -0
.DS_Store
CHANGED
Binary files a/.DS_Store and b/.DS_Store differ
|
|
app.py
CHANGED
@@ -7,6 +7,7 @@ import numpy as np
|
|
7 |
import pandas as pd
|
8 |
import math
|
9 |
from transformers import CLIPTextModel, CLIPTokenizer
|
|
|
10 |
|
11 |
# model_id = "stabilityai/stable-diffusion-2-1-base"
|
12 |
# text_model_id = "CompVis/stable-diffusion-v-1-4-original"
|
@@ -216,42 +217,39 @@ model = AutoModel.from_pretrained(clip_model_id)
|
|
216 |
model = model.to(device)
|
217 |
|
218 |
examples = [
|
219 |
-
["
|
220 |
-
["
|
221 |
-
["
|
222 |
-
["img2.jpg", 3, 1, 25, 0],
|
223 |
-
["img3.jpg", 3, 1, 25, 0],
|
224 |
]
|
|
|
225 |
|
226 |
|
227 |
-
with gr.Blocks() as demo:
|
228 |
-
with gr.Row():
|
229 |
-
gr.Markdown(
|
230 |
-
"""# Soho-Clip
|
231 |
-
""")
|
232 |
|
|
|
233 |
with gr.Row():
|
234 |
with gr.Column(scale=5):
|
235 |
gr.Markdown(
|
236 |
"""
|
|
|
|
|
237 |
A tool for exploring CLIP embedding spaces.
|
238 |
|
239 |
-
Try uploading a few images/add text prompts and click generate images.
|
240 |
""")
|
241 |
-
with gr.Column(scale=3):
|
242 |
with gr.Row():
|
243 |
-
with gr.Column(scale=1, min_width=
|
244 |
-
gr.
|
245 |
-
with gr.Column(scale=1, min_width=
|
246 |
-
gr.Markdown("
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
with gr.
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
|
256 |
with gr.Row():
|
257 |
for i in range(max_tabs):
|
|
|
7 |
import pandas as pd
|
8 |
import math
|
9 |
from transformers import CLIPTextModel, CLIPTokenizer
|
10 |
+
import os
|
11 |
|
12 |
# model_id = "stabilityai/stable-diffusion-2-1-base"
|
13 |
# text_model_id = "CompVis/stable-diffusion-v-1-4-original"
|
|
|
217 |
model = model.to(device)
|
218 |
|
219 |
examples = [
|
220 |
+
["SohoJoeEth.jpeg", "Ray-Liotta-Goodfellas.jpg", "SohoJoeEth + Ray.jpeg"],
|
221 |
+
# ["SohoJoeEth.jpeg", "Donkey.jpg", "SohoJoeEth + Donkey.jpeg"],
|
222 |
+
# ["SohoJoeEth.jpeg", "Snoop Dogg.jpg", "SohoJoeEth + Snoop Dogg.jpeg"],
|
|
|
|
|
223 |
]
|
224 |
+
tile_size = 100
|
225 |
|
226 |
|
|
|
|
|
|
|
|
|
|
|
227 |
|
228 |
+
with gr.Blocks() as demo:
|
229 |
with gr.Row():
|
230 |
with gr.Column(scale=5):
|
231 |
gr.Markdown(
|
232 |
"""
|
233 |
+
# Soho-Clip
|
234 |
+
|
235 |
A tool for exploring CLIP embedding spaces.
|
236 |
|
237 |
+
Try uploading a few images and/or add some text prompts and click generate images.
|
238 |
""")
|
239 |
+
with gr.Column(scale=2, min_width=(tile_size+20)*3):
|
240 |
with gr.Row():
|
241 |
+
with gr.Column(scale=1, min_width=tile_size):
|
242 |
+
gr.Markdown("## Input 1")
|
243 |
+
with gr.Column(scale=1, min_width=tile_size):
|
244 |
+
gr.Markdown("## Input 2")
|
245 |
+
with gr.Column(scale=1, min_width=tile_size):
|
246 |
+
gr.Markdown("## Generates:")
|
247 |
+
for example in examples:
|
248 |
+
with gr.Row():
|
249 |
+
for image in example:
|
250 |
+
with gr.Column(scale=1, min_width=tile_size):
|
251 |
+
image_path = os.path.join("Images", image)
|
252 |
+
gr.Image(value = image_path, shape=(tile_size,tile_size), show_label=False, interactive=False).style(height=tile_size, width=tile_size)
|
253 |
|
254 |
with gr.Row():
|
255 |
for i in range(max_tabs):
|
images/Donkey.jpg
ADDED
Ray-Liotta-Goodfellas.jpg β images/Ray-Liotta-Goodfellas.jpg
RENAMED
File without changes
|
images/Snoop Dogg.jpg
ADDED
images/SohoJoeEth + Donkey.jpeg
ADDED
SohoJoeEth + Ray.jpeg β images/SohoJoeEth + Ray.jpeg
RENAMED
File without changes
|
images/SohoJoeEth + Snoop Dogg.jpeg
ADDED
SohoJoeEth.jpeg β images/SohoJoeEth.jpeg
RENAMED
File without changes
|
pup1.jpg β images/pup1.jpg
RENAMED
File without changes
|
pup2.jpg β images/pup2.jpg
RENAMED
File without changes
|
pup3.jpg β images/pup3.jpg
RENAMED
File without changes
|
pup4.jpeg β images/pup4.jpeg
RENAMED
File without changes
|
pup5.jpg β images/pup5.jpg
RENAMED
File without changes
|