shivangibithel commited on
Commit
a7358e7
1 Parent(s): 78bef2b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -6
app.py CHANGED
@@ -11,22 +11,26 @@ import pickletools
11
  from transformers import AutoTokenizer, CLIPTextModelWithProjection
12
 
13
  # loading the train dataset
14
- with open('clip_train.pkl', 'rb') as f:
15
- temp_d = pickletools.dis(f)
16
  # train_xv = temp_d['image'].astype(np.float64) # Array of image features : np ndarray
17
  # train_xt = temp_d['text'].astype(np.float64) # Array of text features : np ndarray
18
  # train_yv = temp_d['label'] # Array of labels
19
- train_yt = temp_d['label'] # Array of labels
20
  # ids = list(temp_d['ids']) # image names == len(images)
21
 
 
 
22
  # loading the test dataset
23
- with open('clip_test.pkl', 'rb') as f:
24
- temp_d = pickletools.dis(f)
25
  # test_xv = temp_d['image'].astype(np.float64)
26
- test_xt = temp_d['text'].astype(np.float64)
27
  # test_yv = temp_d['label']
28
  # test_yt = temp_d['label']
29
 
 
 
30
  # Map the image ids to the corresponding image URLs
31
  image_map_name = 'pascal_dataset.csv'
32
  df = pd.read_csv(image_map_name)
 
11
  from transformers import AutoTokenizer, CLIPTextModelWithProjection
12
 
13
  # loading the train dataset
14
+ # with open('clip_train.pkl', 'rb') as f:
15
+ # temp_d = pickletools.dis(f)
16
  # train_xv = temp_d['image'].astype(np.float64) # Array of image features : np ndarray
17
  # train_xt = temp_d['text'].astype(np.float64) # Array of text features : np ndarray
18
  # train_yv = temp_d['label'] # Array of labels
19
+ # train_yt = temp_d['label'] # Array of labels
20
  # ids = list(temp_d['ids']) # image names == len(images)
21
 
22
+ train_yt = np.load("train_yt.npy")
23
+
24
  # loading the test dataset
25
+ # with open('clip_test.pkl', 'rb') as f:
26
+ # temp_d = pickletools.dis(f)
27
  # test_xv = temp_d['image'].astype(np.float64)
28
+ # test_xt = temp_d['text'].astype(np.float64)
29
  # test_yv = temp_d['label']
30
  # test_yt = temp_d['label']
31
 
32
+ test_xt = np.load("test_xt.npy")
33
+
34
  # Map the image ids to the corresponding image URLs
35
  image_map_name = 'pascal_dataset.csv'
36
  df = pd.read_csv(image_map_name)