gchhablani commited on
Commit
e1a3400
1 Parent(s): c7cc540

Update app

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. app.py +3 -4
  2. resize_images.py +3 -3
  3. resized_images/val2014/COCO_val2014_000000000757.jpg +0 -0
  4. resized_images/val2014/COCO_val2014_000000013466.jpg +0 -0
  5. resized_images/val2014/COCO_val2014_000000015517.jpg +0 -0
  6. resized_images/val2014/COCO_val2014_000000017018.jpg +0 -0
  7. resized_images/val2014/COCO_val2014_000000023899.jpg +0 -0
  8. resized_images/val2014/COCO_val2014_000000029465.jpg +0 -0
  9. resized_images/val2014/COCO_val2014_000000032901.jpg +0 -0
  10. resized_images/val2014/COCO_val2014_000000036607.jpg +0 -0
  11. resized_images/val2014/COCO_val2014_000000046269.jpg +0 -0
  12. resized_images/val2014/COCO_val2014_000000050165.jpg +0 -0
  13. resized_images/val2014/COCO_val2014_000000066973.jpg +0 -0
  14. resized_images/val2014/COCO_val2014_000000068411.jpg +0 -0
  15. resized_images/val2014/COCO_val2014_000000074646.jpg +0 -0
  16. resized_images/val2014/COCO_val2014_000000079837.jpg +0 -0
  17. resized_images/val2014/COCO_val2014_000000084533.jpg +0 -0
  18. resized_images/val2014/COCO_val2014_000000090255.jpg +0 -0
  19. resized_images/val2014/COCO_val2014_000000095805.jpg +0 -0
  20. resized_images/val2014/COCO_val2014_000000099177.jpg +0 -0
  21. resized_images/val2014/COCO_val2014_000000109055.jpg +0 -0
  22. resized_images/val2014/COCO_val2014_000000109316.jpg +0 -0
  23. resized_images/val2014/COCO_val2014_000000111546.jpg +0 -0
  24. resized_images/val2014/COCO_val2014_000000117328.jpg +0 -0
  25. resized_images/val2014/COCO_val2014_000000117374.jpg +0 -0
  26. resized_images/val2014/COCO_val2014_000000121031.jpg +0 -0
  27. resized_images/val2014/COCO_val2014_000000132042.jpg +0 -0
  28. resized_images/val2014/COCO_val2014_000000144935.jpg +0 -0
  29. resized_images/val2014/COCO_val2014_000000151393.jpg +0 -0
  30. resized_images/val2014/COCO_val2014_000000153011.jpg +0 -0
  31. resized_images/val2014/COCO_val2014_000000156532.jpg +0 -0
  32. resized_images/val2014/COCO_val2014_000000163348.jpg +0 -0
  33. resized_images/val2014/COCO_val2014_000000163640.jpg +0 -0
  34. resized_images/val2014/COCO_val2014_000000167353.jpg +0 -0
  35. resized_images/val2014/COCO_val2014_000000169143.jpg +0 -0
  36. resized_images/val2014/COCO_val2014_000000171255.jpg +0 -0
  37. resized_images/val2014/COCO_val2014_000000187565.jpg +0 -0
  38. resized_images/val2014/COCO_val2014_000000190585.jpg +0 -0
  39. resized_images/val2014/COCO_val2014_000000190689.jpg +0 -0
  40. resized_images/val2014/COCO_val2014_000000197716.jpg +0 -0
  41. resized_images/val2014/COCO_val2014_000000208971.jpg +0 -0
  42. resized_images/val2014/COCO_val2014_000000209602.jpg +0 -0
  43. resized_images/val2014/COCO_val2014_000000230561.jpg +0 -0
  44. resized_images/val2014/COCO_val2014_000000238537.jpg +0 -0
  45. resized_images/val2014/COCO_val2014_000000242610.jpg +0 -0
  46. resized_images/val2014/COCO_val2014_000000246717.jpg +0 -0
  47. resized_images/val2014/COCO_val2014_000000260094.jpg +0 -0
  48. resized_images/val2014/COCO_val2014_000000261758.jpg +0 -0
  49. resized_images/val2014/COCO_val2014_000000270381.jpg +0 -0
  50. resized_images/val2014/COCO_val2014_000000277440.jpg +0 -0
app.py CHANGED
@@ -103,10 +103,9 @@ if state.image_file is None:
103
  image = plt.imread(image_path)
104
  state.image = image
105
 
106
- col1, col2, col3 = st.beta_columns([3,3,3])
107
- col1.write("")
108
- col3.write("")
109
- if col2.button(
110
  "Get a random example",
111
  help="Get a random example from the 100 `seeded` image-text pairs.",
112
  ):
 
103
  image = plt.imread(image_path)
104
  state.image = image
105
 
106
+ # col1, col2, col3 = st.beta_columns([3,3,3])
107
+
108
+ if st.button(
 
109
  "Get a random example",
110
  help="Get a random example from the 100 `seeded` image-text pairs.",
111
  ):
resize_images.py CHANGED
@@ -2,7 +2,7 @@ import cv2
2
  import os
3
 
4
 
5
- # A function to resize the images with longer side to 500 pixels with cubic interpolation and save to a new directory
6
  def resize_images(path, new_path):
7
  if not os.path.exists(new_path):
8
  os.makedirs(new_path)
@@ -11,10 +11,10 @@ def resize_images(path, new_path):
11
  img = cv2.imread(os.path.join(path, filename))
12
  height, width, channels = img.shape
13
  if height > width:
14
- new_height = 500
15
  new_width = int(width * new_height / height)
16
  else:
17
- new_width = 500
18
  new_height = int(height * new_width / width)
19
  img = cv2.resize(img, (new_width, new_height), interpolation=cv2.INTER_CUBIC)
20
  cv2.imwrite(os.path.join(new_path, filename), img)
 
2
  import os
3
 
4
 
5
+ # A function to resize the images with longer side to 300 pixels with cubic interpolation and save to a new directory
6
  def resize_images(path, new_path):
7
  if not os.path.exists(new_path):
8
  os.makedirs(new_path)
 
11
  img = cv2.imread(os.path.join(path, filename))
12
  height, width, channels = img.shape
13
  if height > width:
14
+ new_height = 300
15
  new_width = int(width * new_height / height)
16
  else:
17
+ new_width = 300
18
  new_height = int(height * new_width / width)
19
  img = cv2.resize(img, (new_width, new_height), interpolation=cv2.INTER_CUBIC)
20
  cv2.imwrite(os.path.join(new_path, filename), img)
resized_images/val2014/COCO_val2014_000000000757.jpg CHANGED
resized_images/val2014/COCO_val2014_000000013466.jpg CHANGED
resized_images/val2014/COCO_val2014_000000015517.jpg CHANGED
resized_images/val2014/COCO_val2014_000000017018.jpg CHANGED
resized_images/val2014/COCO_val2014_000000023899.jpg CHANGED
resized_images/val2014/COCO_val2014_000000029465.jpg CHANGED
resized_images/val2014/COCO_val2014_000000032901.jpg CHANGED
resized_images/val2014/COCO_val2014_000000036607.jpg CHANGED
resized_images/val2014/COCO_val2014_000000046269.jpg CHANGED
resized_images/val2014/COCO_val2014_000000050165.jpg CHANGED
resized_images/val2014/COCO_val2014_000000066973.jpg CHANGED
resized_images/val2014/COCO_val2014_000000068411.jpg CHANGED
resized_images/val2014/COCO_val2014_000000074646.jpg CHANGED
resized_images/val2014/COCO_val2014_000000079837.jpg CHANGED
resized_images/val2014/COCO_val2014_000000084533.jpg CHANGED
resized_images/val2014/COCO_val2014_000000090255.jpg CHANGED
resized_images/val2014/COCO_val2014_000000095805.jpg CHANGED
resized_images/val2014/COCO_val2014_000000099177.jpg CHANGED
resized_images/val2014/COCO_val2014_000000109055.jpg CHANGED
resized_images/val2014/COCO_val2014_000000109316.jpg CHANGED
resized_images/val2014/COCO_val2014_000000111546.jpg CHANGED
resized_images/val2014/COCO_val2014_000000117328.jpg CHANGED
resized_images/val2014/COCO_val2014_000000117374.jpg CHANGED
resized_images/val2014/COCO_val2014_000000121031.jpg CHANGED
resized_images/val2014/COCO_val2014_000000132042.jpg CHANGED
resized_images/val2014/COCO_val2014_000000144935.jpg CHANGED
resized_images/val2014/COCO_val2014_000000151393.jpg CHANGED
resized_images/val2014/COCO_val2014_000000153011.jpg CHANGED
resized_images/val2014/COCO_val2014_000000156532.jpg CHANGED
resized_images/val2014/COCO_val2014_000000163348.jpg CHANGED
resized_images/val2014/COCO_val2014_000000163640.jpg CHANGED
resized_images/val2014/COCO_val2014_000000167353.jpg CHANGED
resized_images/val2014/COCO_val2014_000000169143.jpg CHANGED
resized_images/val2014/COCO_val2014_000000171255.jpg CHANGED
resized_images/val2014/COCO_val2014_000000187565.jpg CHANGED
resized_images/val2014/COCO_val2014_000000190585.jpg CHANGED
resized_images/val2014/COCO_val2014_000000190689.jpg CHANGED
resized_images/val2014/COCO_val2014_000000197716.jpg CHANGED
resized_images/val2014/COCO_val2014_000000208971.jpg CHANGED
resized_images/val2014/COCO_val2014_000000209602.jpg CHANGED
resized_images/val2014/COCO_val2014_000000230561.jpg CHANGED
resized_images/val2014/COCO_val2014_000000238537.jpg CHANGED
resized_images/val2014/COCO_val2014_000000242610.jpg CHANGED
resized_images/val2014/COCO_val2014_000000246717.jpg CHANGED
resized_images/val2014/COCO_val2014_000000260094.jpg CHANGED
resized_images/val2014/COCO_val2014_000000261758.jpg CHANGED
resized_images/val2014/COCO_val2014_000000270381.jpg CHANGED
resized_images/val2014/COCO_val2014_000000277440.jpg CHANGED