LucyintheSky commited on
Commit
9ca427b
β€’
1 Parent(s): 6dbf6fd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -8
app.py CHANGED
@@ -31,11 +31,6 @@ def search(image_dict):
31
 
32
  query_image = Image.open(image_dict['composite']).convert(mode='RGB')
33
 
34
- #query_image.thumbnail((1000,1000))
35
-
36
-
37
- #query_image = query_image.resize((160,160))
38
-
39
  print('search')
40
  scores, retrieved_examples = get_neighbors(query_image)
41
 
@@ -49,14 +44,14 @@ def search(image_dict):
49
  #print('label', label)
50
  result.append((retrieved_examples["image"][i], id))
51
 
52
- return result, query_image
53
 
54
  iface = gr.Interface(fn=search,
55
  description="""
56
  <center><img width="500" src="https://cdn.discordapp.com/attachments/1120417968032063538/1201666647157657640/LucyITS-2022-blk.png?ex=65caa646&is=65b83146&hm=09ad6fe279edc3a32981306d563e63af815d760fc0d8d0a3fbef4e4553c0a83a&"> </center>
 
57
  """,
58
  inputs=gr.ImageEditor(type='filepath', value={'background': './template.JPG', 'layers': None, 'composite': None}),
59
- outputs=[gr.Gallery(label='Similar', object_fit='contain'), gr.Image(label='Face')],
60
- #examples=[['./images/tony.jpg'],['./images/jessica.jpg'],['./images/scarlett.jpg'],['./images/christian.jpg']],
61
  theme = gr.themes.Base(primary_hue="teal",secondary_hue="teal",neutral_hue="slate"),)
62
  iface.launch()
 
31
 
32
  query_image = Image.open(image_dict['composite']).convert(mode='RGB')
33
 
 
 
 
 
 
34
  print('search')
35
  scores, retrieved_examples = get_neighbors(query_image)
36
 
 
44
  #print('label', label)
45
  result.append((retrieved_examples["image"][i], id))
46
 
47
+ return result
48
 
49
  iface = gr.Interface(fn=search,
50
  description="""
51
  <center><img width="500" src="https://cdn.discordapp.com/attachments/1120417968032063538/1201666647157657640/LucyITS-2022-blk.png?ex=65caa646&is=65b83146&hm=09ad6fe279edc3a32981306d563e63af815d760fc0d8d0a3fbef4e4553c0a83a&"> </center>
52
+ <center> Sketch to find your favorite Lucy in the Sku dress! </center>
53
  """,
54
  inputs=gr.ImageEditor(type='filepath', value={'background': './template.JPG', 'layers': None, 'composite': None}),
55
+ outputs=gr.Gallery(label='Similar', object_fit='contain'),
 
56
  theme = gr.themes.Base(primary_hue="teal",secondary_hue="teal",neutral_hue="slate"),)
57
  iface.launch()