osanchik commited on
Commit
71e4505
·
1 Parent(s): 2b0b9f4

updated image dir

Browse files
Files changed (3) hide show
  1. .gitignore +3 -0
  2. app.py +4 -3
  3. setup.py +3 -2
.gitignore ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ .DS_Store
2
+ flickr30k_images
3
+ __pycache__
app.py CHANGED
@@ -33,7 +33,8 @@ def show_landing() :
33
 
34
  st.title('Find my pic!')
35
 
36
- search_request = st.text_input('', 'Search ...')
 
37
 
38
  action = st.container()
39
  results = st.container()
@@ -45,11 +46,11 @@ def show_landing() :
45
  'img/',
46
  results)
47
 
48
- if action.button('Find Relsease 2!') and os.path.exists('flickr30k_images_SAVE') :
49
  search_result = search2(search_request)
50
  show_result(search_request,
51
  search_result,
52
- 'flickr30k_images_SAVE/',
53
  results)
54
  return
55
 
 
33
 
34
  st.title('Find my pic!')
35
 
36
+ search_request = st.text_input('Search for images',
37
+ 'Search ...')
38
 
39
  action = st.container()
40
  results = st.container()
 
46
  'img/',
47
  results)
48
 
49
+ if action.button('Find Relsease 2!') and os.path.exists(IMAGE_DIR) :
50
  search_result = search2(search_request)
51
  show_result(search_request,
52
  search_result,
53
+ IMAGE_DIR+'/',
54
  results)
55
  return
56
 
setup.py CHANGED
@@ -2,16 +2,17 @@
2
  import os
3
  import requests, zipfile, io
4
 
 
 
5
  def downlad_images() :
6
 
7
- img_dir = 'flickr30k_images'
8
  zip_file = 'data/flickr.zip'
9
 
10
  #TODO : zip_file_url?
11
  zip_file_url = 'https://drive.google.com/open?id=14QhofCbby053kWbVeWEBHCxOROQS-bjN&authuser=0'
12
 
13
  try :
14
- if not os.path.exists(img_dir) :
15
  if not os.path.exists(zip_file) :
16
  r = requests.get(zip_file_url)
17
  z = zipfile.ZipFile(io.BytesIO(r.content))
 
2
  import os
3
  import requests, zipfile, io
4
 
5
+ IMAGE_DIR = 'flickr30k_images/flickr30k_images'
6
+
7
  def downlad_images() :
8
 
 
9
  zip_file = 'data/flickr.zip'
10
 
11
  #TODO : zip_file_url?
12
  zip_file_url = 'https://drive.google.com/open?id=14QhofCbby053kWbVeWEBHCxOROQS-bjN&authuser=0'
13
 
14
  try :
15
+ if not os.path.exists(IMAGE_DIR) :
16
  if not os.path.exists(zip_file) :
17
  r = requests.get(zip_file_url)
18
  z = zipfile.ZipFile(io.BytesIO(r.content))