Skip to content

Commit d5fb51c

Browse files
committed
add folder data, models
1 parent f975169 commit d5fb51c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1560908
-3
lines changed

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,8 @@ Makefile.config
5050
# Data and models are either
5151
# 1. reference, and not casually committed
5252
# 2. custom, and live on their own unless they're deliberated contributed
53-
data/*
54-
models/*
5553
*.caffemodel
5654
*.solverstate
57-
*.binaryproto
5855
*leveldb
5956
*lmdb
6057

data/cifar10/create_imagenet.sh

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#!/usr/bin/env sh
2+
# Create the imagenet lmdb inputs
3+
# N.B. set the path to the imagenet train + val data dirs
4+
5+
EXAMPLE=data/cifar10
6+
DATA=data/cifar10
7+
TOOLS=build/tools
8+
9+
TRAIN_DATA_ROOT=data/cifar10/
10+
VAL_DATA_ROOT=data/cifar10/
11+
12+
# Set RESIZE=true to resize the images to 256x256. Leave as false if images have
13+
# already been resized using another tool.
14+
RESIZE=true
15+
if $RESIZE; then
16+
RESIZE_HEIGHT=256
17+
RESIZE_WIDTH=256
18+
else
19+
RESIZE_HEIGHT=0
20+
RESIZE_WIDTH=0
21+
fi
22+
23+
if [ ! -d "$TRAIN_DATA_ROOT" ]; then
24+
echo "Error: TRAIN_DATA_ROOT is not a path to a directory: $TRAIN_DATA_ROOT"
25+
echo "Set the TRAIN_DATA_ROOT variable in create_imagenet.sh to the path" \
26+
"where the ImageNet training data is stored."
27+
exit 1
28+
fi
29+
30+
if [ ! -d "$VAL_DATA_ROOT" ]; then
31+
echo "Error: VAL_DATA_ROOT is not a path to a directory: $VAL_DATA_ROOT"
32+
echo "Set the VAL_DATA_ROOT variable in create_imagenet.sh to the path" \
33+
"where the ImageNet validation data is stored."
34+
exit 1
35+
fi
36+
37+
echo "Creating train leveldb..."
38+
39+
GLOG_logtostderr=1 $TOOLS/convert_imageset \
40+
--resize_height=$RESIZE_HEIGHT \
41+
--resize_width=$RESIZE_WIDTH \
42+
--shuffle \
43+
--backend="leveldb" \
44+
$TRAIN_DATA_ROOT \
45+
$DATA/train.txt \
46+
$EXAMPLE/cifar10_train_leveldb
47+
48+
echo "Creating val leveldb..."
49+
50+
GLOG_logtostderr=1 $TOOLS/convert_imageset \
51+
--resize_height=$RESIZE_HEIGHT \
52+
--resize_width=$RESIZE_WIDTH \
53+
--shuffle \
54+
--backend="leveldb" \
55+
$VAL_DATA_ROOT \
56+
$DATA/val.txt \
57+
$EXAMPLE/cifar10_val_leveldb
58+
59+
echo "Done."

data/cifar10/demo_imgs/air1.jpg

858 Bytes
Loading

data/cifar10/demo_imgs/air2.jpg

810 Bytes
Loading

data/cifar10/demo_imgs/bird1.jpg

883 Bytes
Loading

data/cifar10/demo_imgs/bird2.jpg

906 Bytes
Loading

data/cifar10/demo_imgs/bus1.jpg

951 Bytes
Loading

data/cifar10/demo_imgs/bus2.jpg

1013 Bytes
Loading

data/cifar10/demo_imgs/car1.jpg

976 Bytes
Loading

data/cifar10/demo_imgs/car2.jpg

997 Bytes
Loading

data/cifar10/demo_imgs/deer1.jpg

888 Bytes
Loading

data/cifar10/demo_imgs/deer2.jpg

934 Bytes
Loading

data/cifar10/demo_imgs/horse1.jpg

989 Bytes
Loading

data/cifar10/demo_imgs/horse2.jpg

921 Bytes
Loading

data/cifar10/demo_imgs/img_list.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/home/titan/deep/caffe-cvprw15/examples/cvprw15-cifar10/imgs/horse2.jpg
2+
/home/titan/deep/caffe-cvprw15/examples/cvprw15-cifar10/imgs/horse1.jpg
3+
/home/titan/deep/caffe-cvprw15/examples/cvprw15-cifar10/imgs/car2.jpg
4+
/home/titan/deep/caffe-cvprw15/examples/cvprw15-cifar10/imgs/bird2.jpg
5+
/home/titan/deep/caffe-cvprw15/examples/cvprw15-cifar10/imgs/bus1.jpg
6+
/home/titan/deep/caffe-cvprw15/examples/cvprw15-cifar10/imgs/car1.jpg
7+
/home/titan/deep/caffe-cvprw15/examples/cvprw15-cifar10/imgs/air1.jpg
8+
/home/titan/deep/caffe-cvprw15/examples/cvprw15-cifar10/imgs/bird1.jpg
9+
/home/titan/deep/caffe-cvprw15/examples/cvprw15-cifar10/imgs/air2.jpg
10+
/home/titan/deep/caffe-cvprw15/examples/cvprw15-cifar10/imgs/bus2.jpg
11+
/home/titan/deep/caffe-cvprw15/examples/cvprw15-cifar10/imgs/deer1.jpg
12+
/home/titan/deep/caffe-cvprw15/examples/cvprw15-cifar10/imgs/deer2.jpg

data/cifar10/get_cifar10.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env sh
2+
# This scripts downloads the CIFAR10 (binary version) data and unzips it.
3+
4+
DIR="$( cd "$(dirname "$0")" ; pwd -P )"
5+
cd $DIR
6+
7+
echo "Downloading..."
8+
9+
wget --no-check-certificate http://www.cs.toronto.edu/~kriz/cifar-10-binary.tar.gz
10+
11+
echo "Unzipping..."
12+
13+
tar -xf cifar-10-binary.tar.gz && rm -f cifar-10-binary.tar.gz
14+
mv cifar-10-batches-bin/* . && rm -rf cifar-10-batches-bin
15+
16+
# Creation is split out because leveldb sometimes causes segfault
17+
# and needs to be re-created.
18+
19+
echo "Done."

0 commit comments

Comments
 (0)