Spaces:
Runtime error
Runtime error
Update main.py
Browse files
main.py
CHANGED
|
@@ -67,7 +67,7 @@ You will use the [MS-COCO dataset](http://cocodataset.org/#home) to train your m
|
|
| 67 |
|
| 68 |
**Caution: large download ahead**. You'll use the training set, which is a 13GB file.
|
| 69 |
"""
|
| 70 |
-
|
| 71 |
# Download caption annotation files
|
| 72 |
annotation_folder = '/annotations/'
|
| 73 |
if not os.path.exists(os.path.abspath('.') + annotation_folder):
|
|
@@ -80,15 +80,14 @@ if not os.path.exists(os.path.abspath('.') + annotation_folder):
|
|
| 80 |
|
| 81 |
# Download image files
|
| 82 |
image_folder = '/train2014/'
|
| 83 |
-
|
| 84 |
-
|
| 85 |
cache_subdir=os.path.abspath('.'),
|
| 86 |
origin='http://images.cocodataset.org/zips/train2014.zip',
|
| 87 |
extract=True)
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
PATH = os.path.abspath('.') + image_folder
|
| 92 |
|
| 93 |
|
| 94 |
"""## Optional: limit the size of the training set
|
|
|
|
| 67 |
|
| 68 |
**Caution: large download ahead**. You'll use the training set, which is a 13GB file.
|
| 69 |
"""
|
| 70 |
+
wget "http://images.cocodataset.org/zips/train2014.zip"
|
| 71 |
# Download caption annotation files
|
| 72 |
annotation_folder = '/annotations/'
|
| 73 |
if not os.path.exists(os.path.abspath('.') + annotation_folder):
|
|
|
|
| 80 |
|
| 81 |
# Download image files
|
| 82 |
image_folder = '/train2014/'
|
| 83 |
+
|
| 84 |
+
image_zip = tf.keras.utils.get_file('train2014.zip',
|
| 85 |
cache_subdir=os.path.abspath('.'),
|
| 86 |
origin='http://images.cocodataset.org/zips/train2014.zip',
|
| 87 |
extract=True)
|
| 88 |
+
PATH = os.path.dirname(image_zip) + image_folder
|
| 89 |
+
os.remove(image_zip)
|
| 90 |
+
|
|
|
|
| 91 |
|
| 92 |
|
| 93 |
"""## Optional: limit the size of the training set
|