sohojoe commited on
Commit
86fe4d8
β€’
1 Parent(s): 1f50047

make example bigger / clearer

Browse files
.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
- ["frog.png", 3, 1, 25, 0],
220
- ["img0.jpg", 3, 1, 25, 0],
221
- ["img1.jpg", 3, 1, 25, 0],
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=66):
244
- gr.Image(value = "SohoJoeEth.jpeg", shape=(66,66), show_label=False, interactive=False).style(height=66, width=66)
245
- with gr.Column(scale=1, min_width=15):
246
- gr.Markdown("# ")
247
- gr.Markdown("# +")
248
- with gr.Column(scale=1, min_width=66):
249
- gr.Image(value = "Ray-Liotta-Goodfellas.jpg", shape=(66,66), show_label=False, interactive=False).style(height=66, width=66)
250
- with gr.Column(scale=1, min_width=15):
251
- gr.Markdown("# ")
252
- gr.Markdown("# =")
253
- with gr.Column(scale=1, min_width=66):
254
- gr.Image(value = "SohoJoeEth + Ray.jpeg", shape=(66,66), show_label=False, interactive=False).style(height=66, width=66)
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