download-coco-2014.sh 890 Bytes
Newer Older
yangzhong's avatar
yangzhong committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash

: "${DOWNLOAD_PATH:=../coco2014}"
: "${MAX_IMAGES:=5000}"
: "${NUM_WORKERS:=1}"

while [ "$1" != "" ]; do
    case $1 in
        -d | --download-path )       shift
                                     DOWNLOAD_PATH=$1
                                     ;;
    esac
    case $1 in
        -m | --max-images  )        shift
                                      MAX_IMAGES=$1
                                      ;;
    esac
    case $1 in
        -n | --num-workers  )        shift
                                      NUM_WORKERS=$1
                                      ;;
    esac
    shift
done

if [ -z ${MAX_IMAGES} ];
then
    python3 coco.py \
        --dataset-dir ${DOWNLOAD_PATH} \
        --num-workers ${NUM_WORKERS}
else
    python3 coco.py \
        --dataset-dir ${DOWNLOAD_PATH} \
        --max-images ${MAX_IMAGES} \
        --num-workers ${NUM_WORKERS}
fi