raja5259 commited on
Commit
502c1bc
·
verified ·
1 Parent(s): 41c3c09

update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -18
app.py CHANGED
@@ -11,24 +11,11 @@ import zipfile
11
  image_path = "./Images"
12
  captions_path = "."
13
  data_source = 'flickr8k.zip'
14
- entry_name = "Images"
15
-
16
-
17
- z = zipfile.ZipFile(data_source)
18
- entry_info = z.getinfo(entry_name)
19
- i = z.open(entry_name)
20
- o = open(image_path, 'w')
21
- offset = 0
22
- while True:
23
- b = i.read(block_size)
24
- offset += len(b)
25
- set_percentage(float(offset)/float(entry_info.file_size) * 100.)
26
- if b == '':
27
- break
28
- o.write(b)
29
- i.close()
30
- o.close()
31
- set_attributes_from(entry_info)
32
 
33
 
34
 
 
11
  image_path = "./Images"
12
  captions_path = "."
13
  data_source = 'flickr8k.zip'
14
+
15
+
16
+
17
+ with zipfile.ZipFile(data_source, 'r') as zip_ref:
18
+ zip_ref.extractall('.')
 
 
 
 
 
 
 
 
 
 
 
 
 
19
 
20
 
21