Cle*_*sus 5 python computer-vision google-colaboratory semantic-segmentation
COCO 数据集非常大,我无法将其上传到 google colab。有什么办法可以直接将数据集下载到 google colab?
小智 6
另一种方法是仅将注释文件上传到 Google Colab。无需下载图像数据集。我们将使用PyCoco API。接下来,在准备图像时,您可以使用 URL 读取图像文件,而不是从 Drive/local 文件夹访问图像文件!
# The normal method. Read from folder / Drive
I = io.imread('%s/images/%s/%s'%(dataDir,dataType,img['file_name']))
# Instead, use this! Url to load image
I = io.imread(img['coco_url'])
Run Code Online (Sandbox Code Playgroud)
此方法将为您节省大量空间、下载时间和精力。但是,在训练期间您需要有效的互联网连接来获取图像(当然您有,因为您使用的是 colab)。
如果您对使用 COCO 数据集感兴趣,可以查看我在 Medium 上的帖子。
可以直接用wget下载
!wget http://images.cocodataset.org/zips/train2017.zip
Run Code Online (Sandbox Code Playgroud)
此外,您应该使用 GPU 实例,它可以提供 350 GB 的更大空间。