考虑到这一点,我正在寻找一种提取庞大数据集(在这里https://github.com/cvdfoundation/open-images-dataset#download-images-with-bounding-boxes-annotations找到18 TB +)的方法,我需要快速进行处理(即,我不想花两倍的时间来第一次)复制然后解压缩文件)此外,我也不希望档案占用一个甚至20 GB以上的档案的额外空间。
关于如何实现这一目标的任何想法?
考虑到这一点,我正在寻找一种提取庞大数据集(在这里https://github.com/cvdfoundation/open-images-dataset#download-images-with-bounding-boxes-annotations找到18 TB +)的方法,我需要快速进行处理(即,我不想花两倍的时间来第一次)复制然后解压缩文件)此外,我也不希望档案占用一个甚至20 GB以上的档案的额外空间。
关于如何实现这一目标的任何想法?
如果您可以安排将数据直接传输到tar
,则可以将其解压缩并提取,而无需临时文件。
这里是一个例子。首先创建一个要播放的tar文件
$ echo abc >one
$ echo def >two
$ tar cvf test.tar
$ tar cvf test.tar one two
one
two
$ gzip test.tar
删除测试文件
$ rm one two
$ ls one two
ls: cannot access one: No such file or directory
ls: cannot access two: No such file or directory
现在通过将压缩的tar文件输送到tar
命令中来提取内容。
$ cat test.tar.gz | tar xzvf -
one
two
$ ls one two
one two
现在唯一缺少的部分是如何下载数据并将其通过管道传输到tar。假设您可以使用wget
访问URL,则可以将其发送到stdout。所以你最终得到了这个
wget -qO- https://youtdata | tar xzvf -