update app.py
Browse files
app.py
CHANGED
@@ -11,24 +11,11 @@ import zipfile
|
|
11 |
image_path = "./Images"
|
12 |
captions_path = "."
|
13 |
data_source = 'flickr8k.zip'
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
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 |
|