Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
191 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
scripts/*.sh | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
git add . --all | ||
git commit -m "add train without ignored gt." | ||
git commit -m "add moving average" | ||
git push -u origin master | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
set -x | ||
set -e | ||
# ./scripts/eval.sh 1 icdar2013 train 384 384 ckpt | ||
# ./scripts/eval.sh 1 icdar2013 train 512 512 ckpt | ||
|
||
export CUDA_VISIBLE_DEVICES=$1 | ||
DATASET=$2 | ||
SPLIT=$3 | ||
WIDTH=$4 | ||
HEIGHT=$5 | ||
CHECKPOINT_PATH=$6 | ||
|
||
if [ $DATASET == 'synthtext' ] | ||
then | ||
DATA_PATH=SynthText | ||
elif [ $DATASET == 'scut' ] | ||
then | ||
DATA_PATH=SCUT | ||
elif [ $DATASET == 'icdar2013' ] | ||
then | ||
DATA_PATH=ICDAR | ||
elif [ $DATASET == 'icdar2015' ] | ||
then | ||
DATA_PATH=ICDAR | ||
else | ||
echo invalid dataset: $DATASET | ||
exit | ||
fi | ||
|
||
DATASET_DIR=$HOME/dataset/SSD-tf/${DATA_PATH} | ||
|
||
python eval_seglink.py \ | ||
--checkpoint_path=${CHECKPOINT_PATH} \ | ||
--dataset_dir=${DATASET_DIR} \ | ||
--dataset_name=${DATASET} \ | ||
--dataset_split_name=$SPLIT \ | ||
--eval_image_width=${WIDTH} \ | ||
--eval_image_height=${HEIGHT} \ | ||
--gpu_memory_fraction=0.4 \ | ||
--do_grid_search=$7 \ | ||
--using_moving_average=0 | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
set -x | ||
set -e | ||
# ./scripts/test.sh 1 icdar2013 train 384 384 ckpt | ||
# ./scripts/test.sh 1 icdar2013 train 512 512 ckpt | ||
# ./scripts/test.sh 1 icdar2015 train 1280 768 ckpt | ||
|
||
export CUDA_VISIBLE_DEVICES=$1 | ||
CHECKPOINT_PATH=$2 | ||
|
||
|
||
|
||
python test_seglink.py \ | ||
--checkpoint_path=${CHECKPOINT_PATH} \ | ||
--gpu_memory_fraction=-1 \ | ||
--seg_conf_threshold=0.8 \ | ||
--link_conf_threshold=0.5 | ||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
set -x | ||
set -e | ||
# ./scripts/train.sh 0 18 synthtext | ||
export CUDA_VISIBLE_DEVICES=$1 | ||
IMG_PER_GPU=$2 | ||
DATASET=$3 | ||
|
||
CHKPT_PATH=${HOME}/models/seglink/seglink_synthtext | ||
TRAIN_DIR=${HOME}/models/seglink/seglink_icdar2015_384 | ||
#TRAIN_DIR=${HOME}/temp/no-use/seglink/seglink_icdar2015_384 | ||
#CHKPT_PATH=${HOME}/models/ssd-pretrain/seglink | ||
|
||
# get the number of gpus | ||
OLD_IFS="$IFS" | ||
IFS="," | ||
gpus=($CUDA_VISIBLE_DEVICES) | ||
IFS="$OLD_IFS" | ||
NUM_GPUS=${#gpus[@]} | ||
|
||
# batch_size = num_gpus * IMG_PER_GPU | ||
BATCH_SIZE=`expr $NUM_GPUS \* $IMG_PER_GPU` | ||
|
||
#dataset | ||
if [ $DATASET == 'synthtext' ] | ||
then | ||
DATA_PATH=SynthText | ||
elif [ $DATASET == 'scut' ] | ||
then | ||
DATA_PATH=SCUT | ||
elif [ $DATASET == 'icdar2013' ] | ||
then | ||
DATA_PATH=ICDAR | ||
elif [ $DATASET == 'icdar2015' ] | ||
then | ||
DATA_PATH=ICDAR | ||
else | ||
echo invalid dataset: $DATASET | ||
exit | ||
fi | ||
|
||
DATASET_DIR=$HOME/dataset/SSD-tf/${DATA_PATH} | ||
|
||
python train_seglink.py \ | ||
--train_dir=${TRAIN_DIR} \ | ||
--num_gpus=${NUM_GPUS} \ | ||
--learning_rate=0.0001 \ | ||
--gpu_memory_fraction=-1 \ | ||
--train_image_width=384 \ | ||
--train_image_height=384 \ | ||
--batch_size=${BATCH_SIZE}\ | ||
--dataset_dir=${DATASET_DIR} \ | ||
--dataset_name=${DATASET} \ | ||
--dataset_split_name=train \ | ||
--train_with_ignored=0 \ | ||
--checkpoint_path=${CHKPT_PATH} \ | ||
--using_moving_average=0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#python visualize_detection_result.py \ | ||
# --image=~/dataset/ICDAR2015/Challenge2.Task123/Challenge2_Test_Task12_Images/ \ | ||
# --gt=~/dataset/ICDAR2015/Challenge2.Task123/Challenge2_Test_Task1_GT/ \ | ||
# --det=~/temp/no-use/seglink_debug_icdar2013/eval/icdar2013_test/model.ckpt-48176/txt/ \ | ||
# --output=~/temp/no-use/seglink_result | ||
|
||
#python visualize_detection_result.py \ | ||
# --image=~/dataset/ICDAR2015/Challenge2.Task123/Challenge2_Training_Task12_Images/ \ | ||
# --gt=~/dataset/ICDAR2015/Challenge2.Task123/Challenge2_Training_Task1_GT/ \ | ||
# --det=~/temp/no-use/seglink_debug_icdar2013/eval/icdar2013_train/model.ckpt-48176/txt/ \ | ||
# --output=~/temp/no-use/seglink_result | ||
|
||
|
||
python visualize_detection_result.py \ | ||
--image=~/dataset/ICDAR2015/Challenge4/ch4_training_images/ \ | ||
--gt=~/dataset/ICDAR2015/Challenge4/ch4_training_localization_transcription_gt/ \ | ||
--det=~/models/seglink/seglink_icdar2015_without_ignored/eval/icdar2015_train/model.ckpt-72885/seg_link_conf_th_0.900000_0.700000/txt \ | ||
--output=~/temp/no-use/seglink_result_512_train | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters