Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

[image-classification] default use min_random_scale=1, add data/image… #4295

Merged
merged 1 commit into from
Dec 20, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions example/image-classification/data/imagenet1k-val.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

# This file download the imagnet-1k validation dataset and convert it into a rec
# file. One need to provide the URL for the ILSVRC2012_img_val.tar, which can be
# find at http://www.image-net.org/download-images
#
# Example usage (replace the URL with the correct one):
# ./imagenet1k-val.sh http://xxxxxx/challenges/LSVRC/2012/nnoupb/ILSVRC2012_img_val.tar

if [ ! -e ILSVRC2012_img_val.tar ]; then
wget $1
fi
mkdir -p val
tar -xf ILSVRC2012_img_val.tar -C val
wget http://data.mxnet.io/models/imagenet/resnet/val.lst -O imagenet1k-val.lst

CUR_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
MX_DIR=${CUR_DIR}/../../../

python ${CUR_DIR}/../../../tools/im2rec.py --resize 256 --quality 90 --num-thread 16 imagenet1k-val val/

rm -rf val
3 changes: 2 additions & 1 deletion example/image-classification/train_imagenet.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
num_classes = 1000,
num_examples = 1281167,
image_shape = '3,224,224',
min_random_scale = 0.533, # assume input image has min size 480, 0.533 = 256/480
min_random_scale = 1, # if input image has min size k, suggest to use
# 256.0/x, e.g. 0.533 for 480
# train
num_epochs = 80,
lr_step_epochs = '30,60',
Expand Down