jdonaldson commited on
Commit
2b95d34
1 Parent(s): 8e0c6b8

add more examples

Browse files
Files changed (2) hide show
  1. Create Embedding Pickle.ipynb +30 -37
  2. app.py +3 -0
Create Embedding Pickle.ipynb CHANGED
@@ -2,7 +2,7 @@
2
  "cells": [
3
  {
4
  "cell_type": "code",
5
- "execution_count": 1,
6
  "id": "ab9c916b",
7
  "metadata": {},
8
  "outputs": [],
@@ -39,7 +39,7 @@
39
  },
40
  {
41
  "cell_type": "code",
42
- "execution_count": 4,
43
  "id": "b5007694",
44
  "metadata": {
45
  "scrolled": true
@@ -492,14 +492,14 @@
492
  "nvprod4170013v.jpg\n",
493
  "nvprod4440003v.jpg\n",
494
  "nvprod4300026v.jpg\n",
495
- "nvprod4090060v.jpg\n",
496
- "nvprod4380035v.jpg\n"
497
  ]
498
  },
499
  {
500
  "name": "stdout",
501
  "output_type": "stream",
502
  "text": [
 
503
  "nvprod2400039v.jpg\n",
504
  "nvprod4160156v.jpg\n",
505
  "nvprod3940116v.jpg\n",
@@ -1402,14 +1402,14 @@
1402
  "nvprod2680198v.jpg\n",
1403
  "nvprod4330245v.jpg\n",
1404
  "000257.jpg\n",
1405
- "nvprod3600065v.jpg\n",
1406
- "nvprod4350278v.jpg\n"
1407
  ]
1408
  },
1409
  {
1410
  "name": "stdout",
1411
  "output_type": "stream",
1412
  "text": [
 
1413
  "nvprod4260056v.jpg\n",
1414
  "nvprod4380160v.jpg\n",
1415
  "nvprod1600151v.jpg\n",
@@ -1853,17 +1853,17 @@
1853
  "nvprod800008v.jpg\n",
1854
  "nvprod4250084v.jpg\n",
1855
  "nvprod4440027v.jpg\n",
1856
- "nvprod4240084v.jpg\n",
1857
- "nvprod1000083v.jpg\n",
1858
- "nvprod4090044v.jpg\n",
1859
- "nvprod4380011v.jpg\n",
1860
- "001341.jpg\n"
1861
  ]
1862
  },
1863
  {
1864
  "name": "stdout",
1865
  "output_type": "stream",
1866
  "text": [
 
 
 
 
1867
  "nvprod3940098v.jpg\n",
1868
  "nvprod4430149v.jpg\n",
1869
  "nvprod4340020v.jpg\n",
@@ -2310,18 +2310,18 @@
2310
  "nvprod3570136v.jpg\n",
2311
  "nvprod380011v.jpg\n",
2312
  "nvprod4160092v.jpg\n",
2313
- "nvprod3950601v.jpg\n",
2314
- "nvprod4020014v.jpg\n",
2315
- "nvprod4510004v.jpg\n",
2316
- "nvprod4430103v.jpg\n",
2317
- "nvprod4280010v.jpg\n",
2318
- "nvprod4210003v.jpg\n"
2319
  ]
2320
  },
2321
  {
2322
  "name": "stdout",
2323
  "output_type": "stream",
2324
  "text": [
 
 
 
 
 
2325
  "nvprod4110056v.jpg\n",
2326
  "nvprod3740121v.jpg\n",
2327
  "nvprod710115v.jpg\n",
@@ -2764,18 +2764,18 @@
2764
  "nvprod4010010v.jpg\n",
2765
  "nvprod4320109v.jpg\n",
2766
  "nvprod4020019v.jpg\n",
2767
- "nvprod4080003v.jpg\n",
2768
- "nvprod3210052v.jpg\n",
2769
- "nvprod4350067v.jpg\n",
2770
- "nvprod3940030v.jpg\n",
2771
- "nvprod590729v.jpg\n",
2772
- "nvprod4350088v.jpg\n"
2773
  ]
2774
  },
2775
  {
2776
  "name": "stdout",
2777
  "output_type": "stream",
2778
  "text": [
 
 
 
 
 
2779
  "nvprod4350122v.jpg\n",
2780
  "015591.jpg\n",
2781
  "nvprod660206v.jpg\n",
@@ -2842,23 +2842,16 @@
2842
  },
2843
  {
2844
  "cell_type": "code",
2845
- "execution_count": 8,
2846
  "id": "7af97c83",
2847
  "metadata": {},
2848
- "outputs": [
2849
- {
2850
- "data": {
2851
- "text/plain": [
2852
- "'nvprod2400042v'"
2853
- ]
2854
- },
2855
- "execution_count": 8,
2856
- "metadata": {},
2857
- "output_type": "execute_result"
2858
- }
2859
- ],
2860
  "source": [
2861
- "file[:-4]"
 
 
 
 
2862
  ]
2863
  },
2864
  {
 
2
  "cells": [
3
  {
4
  "cell_type": "code",
5
+ "execution_count": 10,
6
  "id": "ab9c916b",
7
  "metadata": {},
8
  "outputs": [],
 
39
  },
40
  {
41
  "cell_type": "code",
42
+ "execution_count": 11,
43
  "id": "b5007694",
44
  "metadata": {
45
  "scrolled": true
 
492
  "nvprod4170013v.jpg\n",
493
  "nvprod4440003v.jpg\n",
494
  "nvprod4300026v.jpg\n",
495
+ "nvprod4090060v.jpg\n"
 
496
  ]
497
  },
498
  {
499
  "name": "stdout",
500
  "output_type": "stream",
501
  "text": [
502
+ "nvprod4380035v.jpg\n",
503
  "nvprod2400039v.jpg\n",
504
  "nvprod4160156v.jpg\n",
505
  "nvprod3940116v.jpg\n",
 
1402
  "nvprod2680198v.jpg\n",
1403
  "nvprod4330245v.jpg\n",
1404
  "000257.jpg\n",
1405
+ "nvprod3600065v.jpg\n"
 
1406
  ]
1407
  },
1408
  {
1409
  "name": "stdout",
1410
  "output_type": "stream",
1411
  "text": [
1412
+ "nvprod4350278v.jpg\n",
1413
  "nvprod4260056v.jpg\n",
1414
  "nvprod4380160v.jpg\n",
1415
  "nvprod1600151v.jpg\n",
 
1853
  "nvprod800008v.jpg\n",
1854
  "nvprod4250084v.jpg\n",
1855
  "nvprod4440027v.jpg\n",
1856
+ "nvprod4240084v.jpg\n"
 
 
 
 
1857
  ]
1858
  },
1859
  {
1860
  "name": "stdout",
1861
  "output_type": "stream",
1862
  "text": [
1863
+ "nvprod1000083v.jpg\n",
1864
+ "nvprod4090044v.jpg\n",
1865
+ "nvprod4380011v.jpg\n",
1866
+ "001341.jpg\n",
1867
  "nvprod3940098v.jpg\n",
1868
  "nvprod4430149v.jpg\n",
1869
  "nvprod4340020v.jpg\n",
 
2310
  "nvprod3570136v.jpg\n",
2311
  "nvprod380011v.jpg\n",
2312
  "nvprod4160092v.jpg\n",
2313
+ "nvprod3950601v.jpg\n"
 
 
 
 
 
2314
  ]
2315
  },
2316
  {
2317
  "name": "stdout",
2318
  "output_type": "stream",
2319
  "text": [
2320
+ "nvprod4020014v.jpg\n",
2321
+ "nvprod4510004v.jpg\n",
2322
+ "nvprod4430103v.jpg\n",
2323
+ "nvprod4280010v.jpg\n",
2324
+ "nvprod4210003v.jpg\n",
2325
  "nvprod4110056v.jpg\n",
2326
  "nvprod3740121v.jpg\n",
2327
  "nvprod710115v.jpg\n",
 
2764
  "nvprod4010010v.jpg\n",
2765
  "nvprod4320109v.jpg\n",
2766
  "nvprod4020019v.jpg\n",
2767
+ "nvprod4080003v.jpg\n"
 
 
 
 
 
2768
  ]
2769
  },
2770
  {
2771
  "name": "stdout",
2772
  "output_type": "stream",
2773
  "text": [
2774
+ "nvprod3210052v.jpg\n",
2775
+ "nvprod4350067v.jpg\n",
2776
+ "nvprod3940030v.jpg\n",
2777
+ "nvprod590729v.jpg\n",
2778
+ "nvprod4350088v.jpg\n",
2779
  "nvprod4350122v.jpg\n",
2780
  "015591.jpg\n",
2781
  "nvprod660206v.jpg\n",
 
2842
  },
2843
  {
2844
  "cell_type": "code",
2845
+ "execution_count": 13,
2846
  "id": "7af97c83",
2847
  "metadata": {},
2848
+ "outputs": [],
 
 
 
 
 
 
 
 
 
 
 
2849
  "source": [
2850
+ "import json\n",
2851
+ "limit = 100\n",
2852
+ "with open(\"lv.json\", \"w\") as f:\n",
2853
+ " enc_list = np.concatenate(encodings).tolist()\n",
2854
+ " json.dump({\"files\" : files[:limit], \"encodings\" : enc_list[:limit]}, f)"
2855
  ]
2856
  },
2857
  {
app.py CHANGED
@@ -72,6 +72,9 @@ iface = gr.Interface(
72
  label="Generated images", show_label=False, elem_id="gallery"
73
  ).style(grid=[2], height="auto")]
74
  ,examples=[
 
 
 
75
  [("Small Purse")],
76
  [("Big Bag")],
77
  ]
 
72
  label="Generated images", show_label=False, elem_id="gallery"
73
  ).style(grid=[2], height="auto")]
74
  ,examples=[
75
+ [("Vacation Star")],
76
+ [("Rock Star")],
77
+ [("Barbie")],
78
  [("Small Purse")],
79
  [("Big Bag")],
80
  ]