Skip to content

Commit

Permalink
Upload pyutils
Browse files Browse the repository at this point in the history
  • Loading branch information
wenz116 committed Oct 22, 2018
1 parent b9c7f30 commit 2dfb29e
Show file tree
Hide file tree
Showing 165 changed files with 48,835 additions and 1 deletion.
1 change: 0 additions & 1 deletion pyutils

This file was deleted.

16 changes: 16 additions & 0 deletions pyutils/mask-faster-rcnn/experiments/cfgs/mobile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
EXP_DIR: mobile
TRAIN:
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
DOUBLE_BIAS: False
SNAPSHOT_PREFIX: mobile_faster_rcnn
TEST:
HAS_RPN: True
POOLING_MODE: crop
23 changes: 23 additions & 0 deletions pyutils/mask-faster-rcnn/experiments/cfgs/res101-lg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
EXP_DIR: res101-lg
TRAIN:
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_POST_NMS_TOP_N: 1000
POOLING_MODE: crop
ANCHOR_SCALES: [2,4,8,16,32]
17 changes: 17 additions & 0 deletions pyutils/mask-faster-rcnn/experiments/cfgs/res101.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
EXP_DIR: res101
TRAIN:
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_mask_rcnn
TEST:
HAS_RPN: True
POOLING_MODE: crop
18 changes: 18 additions & 0 deletions pyutils/mask-faster-rcnn/experiments/cfgs/res101_align.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
EXP_DIR: res101
TRAIN:
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_mask_rcnn
TEST:
HAS_RPN: True
POOLING_MODE: crop
POOLING_ALIGN: True
18 changes: 18 additions & 0 deletions pyutils/mask-faster-rcnn/experiments/cfgs/res101_from_frcn.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
EXP_DIR: res101
TRAIN:
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_mask_rcnn
FROM_FRCN: True
TEST:
HAS_RPN: True
POOLING_MODE: crop
17 changes: 17 additions & 0 deletions pyutils/mask-faster-rcnn/experiments/cfgs/res50.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
EXP_DIR: res50
TRAIN:
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: res50_faster_rcnn
TEST:
HAS_RPN: True
POOLING_MODE: crop
15 changes: 15 additions & 0 deletions pyutils/mask-faster-rcnn/experiments/cfgs/vgg16.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
EXP_DIR: vgg16
TRAIN:
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
SNAPSHOT_PREFIX: vgg16_faster_rcnn
TEST:
HAS_RPN: True
POOLING_MODE: crop
67 changes: 67 additions & 0 deletions pyutils/mask-faster-rcnn/experiments/scripts/convert_vgg16.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!/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"
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

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} ${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} ${EXTRA_ARGS}
fi
fi

Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/bin/bash

set -x
set -e

export PYTHONUNBUFFERED="True"

GPU_ID=$1
DATASET=$2
NET=$3

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

case ${DATASET} in
coco_minus_refer)
TRAIN_IMDB="coco_2014_train_minus_refer_valtest+coco_2014_valminusminival"
TEST_IMDB="coco_2014_minival"
ITERS=1250000
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'`"
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}_mask_rcnn_iter_${ITERS}.pth
else
NET_FINAL=output/${NET}/${TRAIN_IMDB}/default/${NET}_mask_rcnn_iter_${ITERS}.pth
fi
set -x

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

Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/bin/bash

set -x
set -e

export PYTHONUNBUFFERED="True"

GPU_ID=$1
DATASET=$2
NET=$3

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

case ${DATASET} in
coco_minus_refer)
TRAIN_IMDB="coco_2014_train_minus_refer_valtest+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'`"
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}_mask_rcnn_iter_${ITERS}.pth
else
NET_FINAL=output/${NET}/${TRAIN_IMDB}/default/${NET}_mask_rcnn_iter_${ITERS}.pth
fi
set -x

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

Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/bin/bash

set -x
set -e

export PYTHONUNBUFFERED="True"

GPU_ID=$1
DATASET=$2
NET=$3

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

case ${DATASET} in
coco_minus_refer)
TRAIN_IMDB="coco_2014_train_minus_refer_valtest+coco_2014_valminusminival"
TEST_IMDB="coco_2014_minival"
ITERS=1250000
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'`"
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}_mask_rcnn_iter_${ITERS}.pth
else
NET_FINAL=output/${NET}/${TRAIN_IMDB}/default/${NET}_mask_rcnn_iter_${ITERS}.pth
fi
set -x

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

Loading

0 comments on commit 2dfb29e

Please sign in to comment.