Jerome Blin commited on
Commit
7bc58f8
1 Parent(s): 9889760

Add image examples

Browse files
.gitignore CHANGED
@@ -5,3 +5,7 @@
5
  __pycache__/
6
 
7
  flagged
 
 
 
 
 
5
  __pycache__/
6
 
7
  flagged
8
+
9
+ .DS_Store
10
+
11
+ gradio_cached_examples/
fis/app/app.py CHANGED
@@ -36,4 +36,21 @@ def find_most_similar(image: np.ndarray) -> List[Img]:
36
  return images
37
 
38
 
39
- gr.Interface(fn=find_most_similar, inputs="image", outputs=["image" for i in range(5)]).launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  return images
37
 
38
 
39
+ description = """
40
+ Upload an image, and see the **top 5** most similar items in our database.
41
+
42
+ Supported categories are clothing, shoes and bags.
43
+ """
44
+
45
+ images = [image for image in os.listdir('./images') if '.jpeg' in image]
46
+ images = [os.path.join('./images', image) for image in images]
47
+
48
+ gr.Interface(
49
+ title='Fashion image search',
50
+ description=description,
51
+ fn=find_most_similar,
52
+ inputs="image",
53
+ outputs=["image" for i in range(5)],
54
+ examples=images,
55
+ cache_examples=True,
56
+ ).launch()
images/chelsea.jpeg ADDED
images/dress.jpeg ADDED
images/shirt.jpeg ADDED
images/shorts.jpeg ADDED