|
a |
|
b/data/scripts/get_imagenet1000.sh |
|
|
1 |
#!/bin/bash |
|
|
2 |
# YOLOv5 🚀 by Ultralytics, AGPL-3.0 license |
|
|
3 |
# Download ILSVRC2012 ImageNet dataset https://image-net.org |
|
|
4 |
# Example usage: bash data/scripts/get_imagenet.sh |
|
|
5 |
# parent |
|
|
6 |
# ├── yolov5 |
|
|
7 |
# └── datasets |
|
|
8 |
# └── imagenet ← downloads here |
|
|
9 |
|
|
|
10 |
# Arguments (optional) Usage: bash data/scripts/get_imagenet.sh --train --val |
|
|
11 |
if [ "$#" -gt 0 ]; then |
|
|
12 |
for opt in "$@"; do |
|
|
13 |
case "${opt}" in |
|
|
14 |
--train) train=true ;; |
|
|
15 |
--val) val=true ;; |
|
|
16 |
esac |
|
|
17 |
done |
|
|
18 |
else |
|
|
19 |
train=true |
|
|
20 |
val=true |
|
|
21 |
fi |
|
|
22 |
|
|
|
23 |
# Make dir |
|
|
24 |
d='../datasets/imagenet1000' # unzip directory |
|
|
25 |
mkdir -p $d && cd $d |
|
|
26 |
|
|
|
27 |
# Download/unzip train |
|
|
28 |
wget https://github.com/ultralytics/yolov5/releases/download/v1.0/imagenet1000.zip |
|
|
29 |
unzip imagenet1000.zip && rm imagenet1000.zip |