offry commited on
Commit
cf82c86
·
verified ·
1 Parent(s): 2bc4604

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -27,7 +27,7 @@ def create_retrieval_figure(res):
27
  for i, image in zip(range(len(res)), res):
28
  if i >= 10:
29
  break
30
- current_image_path = image.split("/")[3]+"/"+image.split("/")[4]
31
  archive = zipfile.ZipFile('dataset.zip', 'r')
32
  imgfile = archive.read(current_image_path)
33
  image = cv2.imdecode(np.frombuffer(imgfile, np.uint8), 1)
@@ -35,7 +35,7 @@ def create_retrieval_figure(res):
35
  ax = fig.add_subplot(rows, cols, i + 1)
36
  plt.axis('off')
37
  plt.imshow(cv2.cvtColor(image, cv2.COLOR_BGR2RGB))
38
- item_uuid = current_image_path.split("/")[1].split("_photoUUID")[0].split("itemUUID_")[1]
39
  ax.set_title('Top {}'.format(i), fontsize=40)
40
  names = names + "Top " + str(i) + " item UUID is " + item_uuid + "\n"
41
  return fig, names
 
27
  for i, image in zip(range(len(res)), res):
28
  if i >= 10:
29
  break
30
+ current_image_path = "dataset/" + image.split("/")[3] + "/" + image.split("/")[4]
31
  archive = zipfile.ZipFile('dataset.zip', 'r')
32
  imgfile = archive.read(current_image_path)
33
  image = cv2.imdecode(np.frombuffer(imgfile, np.uint8), 1)
 
35
  ax = fig.add_subplot(rows, cols, i + 1)
36
  plt.axis('off')
37
  plt.imshow(cv2.cvtColor(image, cv2.COLOR_BGR2RGB))
38
+ item_uuid = current_image_path.split("/")[2].split("_photoUUID")[0].split("itemUUID_")[1]
39
  ax.set_title('Top {}'.format(i), fontsize=40)
40
  names = names + "Top " + str(i) + " item UUID is " + item_uuid + "\n"
41
  return fig, names