[Tensorflow] 使用 tf.keras.utils.get_file() 下载 MS-COCO 2014 数据集
2019-08-09 08:45
603 查看
原文链接:http://www.cnblogs.com/zlian2016/p/11324982.html
[Tensorflow] 使用 tf.keras.utils.get_file() 下载 MS-COCO 2014 数据集
1 import argparse 2 3 import tensorflow as tf 4 tf.enable_eager_execution() 5 6 7 def main(args): 8 """Download the Microsoft COCO 2014 data set.""" 9 # Annotation zip 10 tf.keras.utils.get_file(fname=args.annotation_zip, 11 origin=args.annotation_origin, 12 cache_dir=args.cache_dir, 13 cache_subdir=args.cache_subdir, 14 extract=True) 15 16 # Train image zip 17 tf.keras.utils.get_file(fname=args.train_zip, 18 origin=args.train_origin, 19 cache_dir=args.cache_dir, 20 cache_subdir=args.cache_subdir, 21 extract=True) 22 23 # Val image zip 24 tf.keras.utils.get_file(fname=args.val_zip, 25 origin=args.val_origin, 26 cache_dir=args.cache_dir, 27 cache_subdir=args.cache_subdir, 28 extract=True) 29 30 # Test image zip 31 tf.keras.utils.get_file(fname=args.test_zip, 32 origin=args.test_origin, 33 cache_dir=args.cache_dir, 34 cache_subdir=args.cache_subdir, 35 extract=True) 36 37 38 if __name__ == '__main__': 39 parser = argparse.ArgumentParser() 40 parser.add_argument('--cache_dir', type=str, default='F:/', help='location to store cached files') 41 parser.add_argument('--cache_subdir', type=str, default='COCO2014/', help='subdirectory under the cache dir') 42 parser.add_argument('--annotation_zip', type=str, default='annotation2014.zip', help='name of annotation zip') 43 parser.add_argument('--annotation_origin', type=str, 44 default='http://images.cocodataset.org/annotations/annotations_trainval2014.zip', 45 help='origin of annotation zip') 46 parser.add_argument('--train_zip', type=str, default='train2014.zip', help='name of train zip') 47 parser.add_argument('--train_origin', type=str, 48 default='http://images.cocodataset.org/zips/train2014.zip', 49 help='origin of train zip') 50 parser.add_argument('--val_zip', type=str, default='val2014.zip', help='name of val zip') 51 parser.add_argument('--val_origin', type=str, 52 default='http://images.cocodataset.org/zips/val2014.zip', 53 help='origin of val zip') 54 parser.add_argument('--test_zip', type=str, default='test2014.zip', help='name of test zip') 55 parser.add_argument('--test_origin', type=str, 56 default='http://images.cocodataset.org/zips/test2014.zip', 57 help='origin of test zip') 58 59 args = parser.parse_args() 60 print(args) 61 62 main(args)
posted on 2019-08-09 08:45 LZ_Jaja 阅读(...) 评论(...) 编辑 收藏
转载于:https://www.cnblogs.com/zlian2016/p/11324982.html
相关文章推荐
- TensorFlow学习--tf.add_to_collection与tf.get_collection使用
- MS coco数据集介绍及下载
- 简单的MS COCO数据集下载方法
- tensorflow中使用tf.variable_scope和tf.get_variable的ValueError
- 卷积神经网络(tf.layers / estimator api)使用TensorFlow'layers'和'estimator'API构建卷积神经网络以对MNIST数字数据集进行分类。
- MS COCO 2014数据集fine-tune FCN做语义分割
- Linux解决问题篇——ftp上传文件(使用put)时,permission denied,下载文件(使用get)时,failed to open file
- 简单Tensorflow线性拟合类及tf.get_variable()使用示例
- TensorFlow数据集操作(使用slim和tfrecord)
- Tensorflow使用TFRecord构建自己的数据集并读取
- MS coco数据集下载
- 【tensorflow】scope的使用以及tf.Variable()和tf.get_variable()的区别
- MS COCO 2014数据集获取类别semantic segmentation
- TensorFlow学习--tf.get_variable使用
- 使用file_get_contents下载图片
- Tensorflow中tf.get_variable和tf.variable_scope的使用
- MS COCO官网数据集(百度云)下载,COCO API、MASK API和Annotation format介绍(来自官网)
- VC中使用GetModuleFileName获取应用程序路径(整理)
- 下载文件 Get File From the Net
- VC中使用GetModuleFileName获取应用程序路径