Skip to content

Autofaster #152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions .gitignore
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ lib/pycocotools
lib/pycocotools/_mask.c
lib/pycocotools/_mask.so
.idea
data/
Empty file modified LICENSE
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions data/.gitignore
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ fast_rcnn_*
VOCdevkit*
coco*
cache
fruits*
Empty file modified data/demo/000456.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified data/demo/000542.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified data/demo/001150.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified data/demo/001763.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified data/demo/004545.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified docker/Dockerfile.cuda-7.5
100644 → 100755
Empty file.
Empty file modified docker/Dockerfile.cuda-8.0
100644 → 100755
Empty file.
27 changes: 27 additions & 0 deletions experiments/cfgs/res101-ivan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
EXP_DIR: res101-ivan
TRAIN:
STEPSIZE: 100
HAS_RPN: True
IMS_PER_BATCH: 1
BBOX_NORMALIZE_TARGETS_PRECOMPUTED: True
RPN_POSITIVE_OVERLAP: 0.7
RPN_BATCHSIZE: 256
PROPOSAL_METHOD: gt
BG_THRESH_LO: 0.0
DISPLAY: 20
BATCH_SIZE: 256
WEIGHT_DECAY: 0.0001
DOUBLE_BIAS: False
SNAPSHOT_PREFIX: res101_faster_rcnn
SCALES: [800]
MAX_SIZE: 1333
TEST:
HAS_RPN: True
SCALES: [800]
MAX_SIZE: 1333
RPN_PRE_NMS_TOP_N: 10000
RPN_POST_NMS_TOP_N: 1500

POOLING_MODE: crop
POOLING_SIZE: 7
ANCHOR_SCALES: [2,4,8,16,32]
3 changes: 2 additions & 1 deletion experiments/cfgs/res101-lg.yml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ TEST:
SCALES: [800]
MAX_SIZE: 1333
RPN_POST_NMS_TOP_N: 1000
POOLING_MODE: crop
POOLING_MODE: crop
ANCHOR_SCALES: [2,4,8,16,32]
3 changes: 3 additions & 0 deletions experiments/cfgs/res101.yml
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
EXP_DIR: res101
TRAIN:
STEPSIZE: 100
HAS_RPN: True
IMS_PER_BATCH: 1
BBOX_NORMALIZE_TARGETS_PRECOMPUTED: True
Expand All @@ -15,3 +16,5 @@ TRAIN:
TEST:
HAS_RPN: True
POOLING_MODE: crop
ANCHOR_SCALES: [8,16,32]
ANCHOR_RATIOS: [0.5,1,2]
Empty file modified experiments/cfgs/res50.yml
100644 → 100755
Empty file.
Empty file modified experiments/cfgs/vgg16.yml
100644 → 100755
Empty file.
Empty file modified experiments/cfgs/vgg16_depre.yml
100644 → 100755
Empty file.
1 change: 0 additions & 1 deletion experiments/logs/.gitignore

This file was deleted.

70 changes: 70 additions & 0 deletions experiments/scripts/convert_vgg16.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#!/bin/bash

set -x
set -e

export PYTHONUNBUFFERED="True"

GPU_ID=$1
DATASET=$2
NET=vgg16

array=( $@ )
len=${#array[@]}
EXTRA_ARGS=${array[@]:2:$len}
EXTRA_ARGS_SLUG=${EXTRA_ARGS// /_}

case ${DATASET} in
pascal_voc)
TRAIN_IMDB="voc_2007_trainval"
TEST_IMDB="voc_2007_test"
STEPSIZE=50000
ITERS=70000
ANCHORS="[8,16,32]"
RATIOS="[0.5,1,2]"
;;
pascal_voc_0712)
TRAIN_IMDB="voc_2007_trainval+voc_2012_trainval"
TEST_IMDB="voc_2007_test"
STEPSIZE=80000
ITERS=110000
ANCHORS="[8,16,32]"
RATIOS="[0.5,1,2]"
;;
coco)
TRAIN_IMDB="coco_2014_train+coco_2014_valminusminival"
TEST_IMDB="coco_2014_minival"
STEPSIZE=350000
ITERS=490000
ANCHORS="[4,8,16,32]"
RATIOS="[0.5,1,2]"
;;
*)
echo "No dataset given"
exit
;;
esac

set +x
NET_FINAL=${NET}_faster_rcnn_iter_${ITERS}
set -x

if [ ! -f ${NET_FINAL}.index ]; then
if [[ ! -z ${EXTRA_ARGS_SLUG} ]]; then
CUDA_VISIBLE_DEVICES=${GPU_ID} time python ./tools/convert_from_depre.py \
--snapshot ${NET_FINAL} \
--imdb ${TRAIN_IMDB} \
--iters ${ITERS} \
--cfg experiments/cfgs/${NET}.yml \
--tag ${EXTRA_ARGS_SLUG} \
--set ANCHOR_SCALES ${ANCHORS} ANCHOR_RATIOS ${RATIOS} TRAIN.STEPSIZE ${STEPSIZE} ${EXTRA_ARGS}
else
CUDA_VISIBLE_DEVICES=${GPU_ID} time python ./tools/convert_from_depre.py \
--snapshot ${NET_FINAL} \
--imdb ${TRAIN_IMDB} \
--iters ${ITERS} \
--cfg experiments/cfgs/${NET}.yml \
--set ANCHOR_SCALES ${ANCHORS} ANCHOR_RATIOS ${RATIOS} TRAIN.STEPSIZE ${STEPSIZE} ${EXTRA_ARGS}
fi
fi

62 changes: 22 additions & 40 deletions experiments/scripts/test_faster_rcnn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,69 +5,51 @@ set -e

export PYTHONUNBUFFERED="True"

GPU_ID=$1
DATASET=$2
NET=$3
ROOT_FASTER=$1
GPU_ID=$2
DATASET=$3
NET=$4
CLASSES=$5
TRAIN_IMDB="${DATASET}_trainval"
TEST_IMDB="${DATASET}_test"
ITERS=$6
STEPSIZE=$7
ANCHORS=$8
RATIOS=$9
CFG_FILE=${10}

array=( $@ )
len=${#array[@]}
EXTRA_ARGS=${array[@]:3:$len}
EXTRA_ARGS=${array[@]:10:$len}
EXTRA_ARGS_SLUG=${EXTRA_ARGS// /_}

case ${DATASET} in
pascal_voc)
TRAIN_IMDB="voc_2007_trainval"
TEST_IMDB="voc_2007_test"
ITERS=70000
ANCHORS="[8,16,32]"
RATIOS="[0.5,1,2]"
;;
pascal_voc_0712)
TRAIN_IMDB="voc_2007_trainval+voc_2012_trainval"
TEST_IMDB="voc_2007_test"
ITERS=110000
ANCHORS="[8,16,32]"
RATIOS="[0.5,1,2]"
;;
coco)
TRAIN_IMDB="coco_2014_train+coco_2014_valminusminival"
TEST_IMDB="coco_2014_minival"
ITERS=490000
ANCHORS="[4,8,16,32]"
RATIOS="[0.5,1,2]"
;;
*)
echo "No dataset given"
exit
;;
esac

LOG="experiments/logs/test_${NET}_${TRAIN_IMDB}_${EXTRA_ARGS_SLUG}.txt.`date +'%Y-%m-%d_%H-%M-%S'`"
LOG="${ROOT_FASTER}/experiments/logs/test_${NET}_${TRAIN_IMDB}_${CFG_FILE}_${EXTRA_ARGS_SLUG}.txt.`date +'%Y-%m-%d_%H-%M-%S'`"
exec &> >(tee -a "$LOG")
echo Logging output to "$LOG"

set +x
if [[ ! -z ${EXTRA_ARGS_SLUG} ]]; then
NET_FINAL=output/${NET}/${TRAIN_IMDB}/${EXTRA_ARGS_SLUG}/${NET}_faster_rcnn_iter_${ITERS}.ckpt
NET_FINAL=${ROOT_FASTER}/output/${CFG_FILE}/${TRAIN_IMDB}/${EXTRA_ARGS_SLUG}/${NET}_faster_rcnn_iter_${ITERS}.ckpt
else
NET_FINAL=output/${NET}/${TRAIN_IMDB}/default/${NET}_faster_rcnn_iter_${ITERS}.ckpt
NET_FINAL=${ROOT_FASTER}/output/${CFG_FILE}/${TRAIN_IMDB}/default/${NET}_faster_rcnn_iter_${ITERS}.ckpt
fi
set -x

if [[ ! -z ${EXTRA_ARGS_SLUG} ]]; then
CUDA_VISIBLE_DEVICES=${GPU_ID} time python ./tools/test_net.py \
CUDA_VISIBLE_DEVICES=${GPU_ID} python ${ROOT_FASTER}/tools/test_net.py \
--imdb ${TEST_IMDB} \
--model ${NET_FINAL} \
--cfg experiments/cfgs/${NET}.yml \
--cfg ${ROOT_FASTER}/experiments/cfgs/${CFG_FILE}.yml \
--classes ${CLASSES} \
--tag ${EXTRA_ARGS_SLUG} \
--net ${NET} \
--set ANCHOR_SCALES ${ANCHORS} ANCHOR_RATIOS ${RATIOS} ${EXTRA_ARGS}
else
CUDA_VISIBLE_DEVICES=${GPU_ID} time python ./tools/test_net.py \
CUDA_VISIBLE_DEVICES=${GPU_ID} python ${ROOT_FASTER}/tools/test_net.py \
--imdb ${TEST_IMDB} \
--model ${NET_FINAL} \
--cfg experiments/cfgs/${NET}.yml \
--cfg ${ROOT_FASTER}/experiments/cfgs/${CFG_FILE}.yml \
--classes ${CLASSES} \
--net ${NET} \
--set ANCHOR_SCALES ${ANCHORS} ANCHOR_RATIOS ${RATIOS} ${EXTRA_ARGS}
fi

76 changes: 31 additions & 45 deletions experiments/scripts/train_faster_rcnn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,79 +5,65 @@ set -e

export PYTHONUNBUFFERED="True"

GPU_ID=$1
DATASET=$2
NET=$3
ROOT_FASTER=$1
GPU_ID=$2
DATASET=$3
NET=$4
CLASSES=$5
TRAIN_IMDB="${DATASET}_trainval"
TEST_IMDB="${DATASET}_test"
ITERS=$6
STEPSIZE=$7
ANCHORS=$8
RATIOS=$9
CFG_FILE=${10}


array=( $@ )
len=${#array[@]}
EXTRA_ARGS=${array[@]:3:$len}
EXTRA_ARGS=${array[@]:10:$len}
EXTRA_ARGS_SLUG=${EXTRA_ARGS// /_}

case ${DATASET} in
pascal_voc)
TRAIN_IMDB="voc_2007_trainval"
TEST_IMDB="voc_2007_test"
STEPSIZE=50000
ITERS=70000
ANCHORS="[8,16,32]"
RATIOS="[0.5,1,2]"
;;
pascal_voc_0712)
TRAIN_IMDB="voc_2007_trainval+voc_2012_trainval"
TEST_IMDB="voc_2007_test"
STEPSIZE=80000
ITERS=110000
ANCHORS="[8,16,32]"
RATIOS="[0.5,1,2]"
;;
coco)
TRAIN_IMDB="coco_2014_train+coco_2014_valminusminival"
TEST_IMDB="coco_2014_minival"
STEPSIZE=350000
ITERS=490000
ANCHORS="[4,8,16,32]"
RATIOS="[0.5,1,2]"
;;
*)
echo "No dataset given"
exit
;;
esac

LOG="experiments/logs/${NET}_${TRAIN_IMDB}_${EXTRA_ARGS_SLUG}_${NET}.txt.`date +'%Y-%m-%d_%H-%M-%S'`"
LOG="${ROOT_FASTER}/experiments/logs/${NET}_${TRAIN_IMDB}_${EXTRA_ARGS_SLUG}_${NET}.txt.`date +'%Y-%m-%d_%H-%M-%S'`"
exec &> >(tee -a "$LOG")
echo Logging output to "$LOG"

echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
echo ${EXTRA_ARGS}

set +x
if [[ ! -z ${EXTRA_ARGS_SLUG} ]]; then
NET_FINAL=output/${NET}/${TRAIN_IMDB}/${EXTRA_ARGS_SLUG}/${NET}_faster_rcnn_iter_${ITERS}.ckpt
NET_FINAL=${ROOT_FASTER}/output/${CFG_FILE}/${TRAIN_IMDB}/${EXTRA_ARGS_SLUG}/${NET}_faster_rcnn_iter_${ITERS}.ckpt
else
NET_FINAL=output/${NET}/${TRAIN_IMDB}/default/${NET}_faster_rcnn_iter_${ITERS}.ckpt
NET_FINAL=${ROOT_FASTER}/output/${CFG_FILE}/${TRAIN_IMDB}/default/${NET}_faster_rcnn_iter_${ITERS}.ckpt
fi
set -x

if [ ! -f ${NET_FINAL}.index ]; then
if [[ ! -z ${EXTRA_ARGS_SLUG} ]]; then
CUDA_VISIBLE_DEVICES=${GPU_ID} time python ./tools/trainval_net.py \
--weight data/imagenet_weights/${NET}.ckpt \
CUDA_VISIBLE_DEVICES=${GPU_ID} python ${ROOT_FASTER}/tools/trainval_net.py \
--weight ${ROOT_FASTER}/data/imagenet_weights/${NET}.ckpt \
--imdb ${TRAIN_IMDB} \
--imdbval ${TEST_IMDB} \
--iters ${ITERS} \
--cfg experiments/cfgs/${NET}.yml \
--cfg ${ROOT_FASTER}/experiments/cfgs/${CFG_FILE}.yml \
--dataset_name ${DATASET} \
--classes ${CLASSES} \
--tag ${EXTRA_ARGS_SLUG} \
--net ${NET} \
--set ANCHOR_SCALES ${ANCHORS} ANCHOR_RATIOS ${RATIOS} TRAIN.STEPSIZE ${STEPSIZE} ${EXTRA_ARGS}
else
CUDA_VISIBLE_DEVICES=${GPU_ID} time python ./tools/trainval_net.py \
--weight data/imagenet_weights/${NET}.ckpt \
CUDA_VISIBLE_DEVICES=${GPU_ID} python ${ROOT_FASTER}/tools/trainval_net.py \
--weight ${ROOT_FASTER}/data/imagenet_weights/${NET}.ckpt \
--imdb ${TRAIN_IMDB} \
--imdbval ${TEST_IMDB} \
--iters ${ITERS} \
--cfg experiments/cfgs/${NET}.yml \
--cfg ${ROOT_FASTER}/experiments/cfgs/${CFG_FILE}.yml \
--dataset_name ${DATASET} \
--classes ${CLASSES} \
--net ${NET} \
--set ANCHOR_SCALES ${ANCHORS} ANCHOR_RATIOS ${RATIOS} TRAIN.STEPSIZE ${STEPSIZE} ${EXTRA_ARGS}
fi
fi

./experiments/scripts/test_faster_rcnn.sh $@
${ROOT_FASTER}/experiments/scripts/test_faster_rcnn.sh $@
Empty file modified lib/Makefile
100644 → 100755
Empty file.
Empty file modified lib/datasets/VOCdevkit-matlab-wrapper/get_voc_opts.m
100644 → 100755
Empty file.
Empty file modified lib/datasets/VOCdevkit-matlab-wrapper/voc_eval.m
100644 → 100755
Empty file.
Empty file modified lib/datasets/VOCdevkit-matlab-wrapper/xVOCap.m
100644 → 100755
Empty file.
Empty file modified lib/datasets/__init__.py
100644 → 100755
Empty file.
Empty file modified lib/datasets/coco.py
100644 → 100755
Empty file.
Loading