2 篇文章带有标签 “tar”

AI 数据集打包发布

数据集打包目录结构

ai-project/
├── labelimg
│   ├── 1.jpg
│   ├── 1.xml
│   ├── 2.jpg
│   ├── 2.xml
│   ├── 3.jpg
│   ├── 3.xml
│   ├── 4.jpg
│   └── 4.xml
├── classes.txt
├── data.yaml
├── images
│   ├── train
│   │   ├── 1.jpg
│   │   └── 2.jpg
│   └── val
│       ├── 3.jpg
│       └── 4.jpg
└── labels
    ├── train
    │   ├── 1.txt
    │   └── 2.txt
    └── val
        ├── 3.txt
        └── 4.txt

打包

DATE=$(date '+%Y-%m-%d')
tar cvf sign-yolo-$DATE.tar labelimg/ classes.txt images/ labels data.yaml

上传数据集服务器

DATASET_SERVER_PATH=username@ip:/data/datasets
scp sign-yolo-$DATE.tar $DATASET_SERVER_PATH

命令tar

    -c, --create Create a new archive.  Arguments supply the names of the files to be archived.
    -x, --extract, --get Extract files from an archive.
    -z, --gzip, --gunzip, --ungzip Filter the archive through gzip(1).
    -j, --bzip2 Filter the archive through bzip2(1).
    -f, --file=ARCHIVE Use archive file or device ARCHIVE.  If this option is not given, tar will first examine the environment variable `TAPE'.  If it is set, its value will be used as the archive  name.   Otherwise, tar will assume the compiled-in default.
    -t, --list List the contents of an archive.
    -v, --verbose Verbosely list files processed.