-
Notifications
You must be signed in to change notification settings - Fork 17
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
1 parent
d5d1103
commit 0de3f0d
Showing
30 changed files
with
2,408 additions
and
1,424 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
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
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
Empty file.
207 changes: 103 additions & 104 deletions
207
libs/configs/cfgs_res50_coco_1x_v1.py → libs/configs/COCO/cfgs_res50_coco_1x_v1.py
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,104 +1,103 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import division, print_function, absolute_import | ||
import os | ||
import tensorflow as tf | ||
import math | ||
|
||
""" | ||
epoch-00: 00.0 epoch-01: 7.40 | ||
epoch-02: 15.4 epoch-03: 18.8 | ||
epoch-04: 20.7 epoch-05: 23.0 | ||
epoch-06: 23.6 epoch-07: 25.3 | ||
epoch-08: 24.7 epoch-09: 26.7 | ||
epoch-11: 26.2 epoch-12: 30.7 | ||
epoch-13: 30.8 epoch-14: 31.1 | ||
epoch-15: 31.2 epoch-16: 31.4 | ||
epoch-19: 31.5 | ||
""" | ||
|
||
# ------------------------------------------------ | ||
VERSION = 'RetinaNet_COCO_1x_20190522' | ||
NET_NAME = 'resnet_v1_50' # 'MobilenetV2' | ||
ADD_BOX_IN_TENSORBOARD = True | ||
|
||
# ---------------------------------------- System_config | ||
ROOT_PATH = os.path.abspath('../') | ||
print(20*"++--") | ||
print(ROOT_PATH) | ||
GPU_GROUP = "0,1,2,3,4,5,6,7" | ||
NUM_GPU = len(GPU_GROUP.strip().split(',')) | ||
SHOW_TRAIN_INFO_INTE = 20 | ||
SMRY_ITER = 200 | ||
SAVE_WEIGHTS_INTE = 20000 * 5 | ||
|
||
SUMMARY_PATH = ROOT_PATH + '/output/summary' | ||
TEST_SAVE_PATH = ROOT_PATH + '/tools/test_result' | ||
|
||
if NET_NAME.startswith("resnet"): | ||
weights_name = NET_NAME | ||
elif NET_NAME.startswith("MobilenetV2"): | ||
weights_name = "mobilenet/mobilenet_v2_1.0_224" | ||
else: | ||
raise Exception('net name must in [resnet_v1_101, resnet_v1_50, MobilenetV2]') | ||
|
||
PRETRAINED_CKPT = ROOT_PATH + '/data/pretrained_weights/' + weights_name + '.ckpt' | ||
TRAINED_CKPT = os.path.join(ROOT_PATH, 'output/trained_weights') | ||
EVALUATE_DIR = ROOT_PATH + '/output/evaluate_result_pickle/' | ||
|
||
# ------------------------------------------ Train config | ||
RESTORE_FROM_RPN = False | ||
FIXED_BLOCKS = 1 # allow 0~3 | ||
FREEZE_BLOCKS = [True, False, False, False, False] # for gluoncv backbone | ||
USE_07_METRIC = True | ||
|
||
MUTILPY_BIAS_GRADIENT = None # 2.0 # if None, will not multipy | ||
GRADIENT_CLIPPING_BY_NORM = None # 10.0 if None, will not clip | ||
|
||
BATCH_SIZE = 1 | ||
EPSILON = 1e-5 | ||
MOMENTUM = 0.9 | ||
LR = 5e-4 * NUM_GPU * BATCH_SIZE | ||
DECAY_STEP = [SAVE_WEIGHTS_INTE*12, SAVE_WEIGHTS_INTE*16, SAVE_WEIGHTS_INTE*20] | ||
MAX_ITERATION = SAVE_WEIGHTS_INTE*20 | ||
WARM_SETP = int(1.0 / 8.0 * SAVE_WEIGHTS_INTE) | ||
|
||
# -------------------------------------------- Data_preprocess_config | ||
DATASET_NAME = 'coco' # 'pascal', 'coco' | ||
PIXEL_MEAN = [123.68, 116.779, 103.939] # R, G, B. In tf, channel is RGB. In openCV, channel is BGR | ||
PIXEL_MEAN_ = [0.485, 0.456, 0.406] | ||
PIXEL_STD = [0.229, 0.224, 0.225] # R, G, B. In tf, channel is RGB. In openCV, channel is BGR | ||
IMG_SHORT_SIDE_LEN = 600 | ||
IMG_MAX_LENGTH = 1000 | ||
CLASS_NUM = 80 | ||
|
||
# --------------------------------------------- Network_config | ||
BATCH_SIZE = 1 | ||
SUBNETS_WEIGHTS_INITIALIZER = tf.random_normal_initializer(mean=0.0, stddev=0.01, seed=None) | ||
SUBNETS_BIAS_INITIALIZER = tf.constant_initializer(value=0.0) | ||
PROBABILITY = 0.01 | ||
FINAL_CONV_BIAS_INITIALIZER = tf.constant_initializer(value=-math.log((1.0 - PROBABILITY) / PROBABILITY)) | ||
WEIGHT_DECAY = 1e-4 | ||
|
||
# ---------------------------------------------Anchor config | ||
LEVEL = ['P3', 'P4', 'P5', 'P6', 'P7'] | ||
BASE_ANCHOR_SIZE_LIST = [32, 64, 128, 256, 512] | ||
ANCHOR_STRIDE = [8, 16, 32, 64, 128] | ||
ANCHOR_SCALES = [2 ** 0, 2 ** (1.0 / 3.0), 2 ** (2.0 / 3.0)] | ||
ANCHOR_RATIOS = [0.5, 1.0, 2.0] | ||
ANCHOR_SCALE_FACTORS = None | ||
USE_CENTER_OFFSET = True | ||
|
||
# --------------------------------------------RPN config | ||
SHARE_NET = True | ||
USE_P5 = True | ||
IOU_POSITIVE_THRESHOLD = 0.5 | ||
IOU_NEGATIVE_THRESHOLD = 0.4 | ||
|
||
NMS = True | ||
NMS_IOU_THRESHOLD = 0.5 | ||
MAXIMUM_DETECTIONS = 100 | ||
FILTERED_SCORE = 0.05 | ||
VIS_SCORE = 0.5 | ||
|
||
|
||
# -*- coding: utf-8 -*- | ||
from __future__ import division, print_function, absolute_import | ||
import os | ||
import tensorflow as tf | ||
import math | ||
|
||
""" | ||
epoch-00: 00.0 epoch-01: 7.40 | ||
epoch-02: 15.4 epoch-03: 18.8 | ||
epoch-04: 20.7 epoch-05: 23.0 | ||
epoch-06: 23.6 epoch-07: 25.3 | ||
epoch-08: 24.7 epoch-09: 26.7 | ||
epoch-11: 26.2 epoch-12: 30.7 | ||
epoch-13: 30.8 epoch-14: 31.1 | ||
epoch-15: 31.2 epoch-16: 31.4 | ||
epoch-19: 31.5 | ||
""" | ||
|
||
# ------------------------------------------------ | ||
VERSION = 'RetinaNet_COCO_1x_20190522' | ||
NET_NAME = 'resnet_v1_50' # 'MobilenetV2' | ||
ADD_BOX_IN_TENSORBOARD = True | ||
|
||
# ---------------------------------------- System_config | ||
ROOT_PATH = os.path.abspath('../') | ||
print(20*"++--") | ||
print(ROOT_PATH) | ||
GPU_GROUP = "0,1,2,3,4,5,6,7" | ||
NUM_GPU = len(GPU_GROUP.strip().split(',')) | ||
SHOW_TRAIN_INFO_INTE = 20 | ||
SMRY_ITER = 200 | ||
SAVE_WEIGHTS_INTE = 20000 * 5 | ||
|
||
SUMMARY_PATH = ROOT_PATH + '/output/summary' | ||
TEST_SAVE_PATH = ROOT_PATH + '/tools/test_result' | ||
|
||
if NET_NAME.startswith("resnet"): | ||
weights_name = NET_NAME | ||
elif NET_NAME.startswith("MobilenetV2"): | ||
weights_name = "mobilenet/mobilenet_v2_1.0_224" | ||
else: | ||
raise Exception('net name must in [resnet_v1_101, resnet_v1_50, MobilenetV2]') | ||
|
||
PRETRAINED_CKPT = ROOT_PATH + '/data/pretrained_weights/' + weights_name + '.ckpt' | ||
TRAINED_CKPT = os.path.join(ROOT_PATH, 'output/trained_weights') | ||
EVALUATE_DIR = ROOT_PATH + '/output/evaluate_result_pickle/' | ||
|
||
# ------------------------------------------ Train config | ||
RESTORE_FROM_RPN = False | ||
FIXED_BLOCKS = 1 # allow 0~3 | ||
FREEZE_BLOCKS = [True, False, False, False, False] # for gluoncv backbone | ||
USE_07_METRIC = True | ||
|
||
MUTILPY_BIAS_GRADIENT = None # 2.0 # if None, will not multipy | ||
GRADIENT_CLIPPING_BY_NORM = None # 10.0 if None, will not clip | ||
|
||
BATCH_SIZE = 1 | ||
EPSILON = 1e-5 | ||
MOMENTUM = 0.9 | ||
LR = 5e-4 * NUM_GPU * BATCH_SIZE | ||
DECAY_STEP = [SAVE_WEIGHTS_INTE*12, SAVE_WEIGHTS_INTE*16, SAVE_WEIGHTS_INTE*20] | ||
MAX_ITERATION = SAVE_WEIGHTS_INTE*20 | ||
WARM_SETP = int(1.0 / 8.0 * SAVE_WEIGHTS_INTE) | ||
|
||
# -------------------------------------------- Data_preprocess_config | ||
DATASET_NAME = 'coco' # 'pascal', 'coco' | ||
PIXEL_MEAN = [123.68, 116.779, 103.939] # R, G, B. In tf, channel is RGB. In openCV, channel is BGR | ||
PIXEL_MEAN_ = [0.485, 0.456, 0.406] | ||
PIXEL_STD = [0.229, 0.224, 0.225] # R, G, B. In tf, channel is RGB. In openCV, channel is BGR | ||
IMG_SHORT_SIDE_LEN = 600 | ||
IMG_MAX_LENGTH = 1000 | ||
CLASS_NUM = 80 | ||
|
||
# --------------------------------------------- Network_config | ||
SUBNETS_WEIGHTS_INITIALIZER = tf.random_normal_initializer(mean=0.0, stddev=0.01, seed=None) | ||
SUBNETS_BIAS_INITIALIZER = tf.constant_initializer(value=0.0) | ||
PROBABILITY = 0.01 | ||
FINAL_CONV_BIAS_INITIALIZER = tf.constant_initializer(value=-math.log((1.0 - PROBABILITY) / PROBABILITY)) | ||
WEIGHT_DECAY = 1e-4 | ||
|
||
# ---------------------------------------------Anchor config | ||
LEVEL = ['P3', 'P4', 'P5', 'P6', 'P7'] | ||
BASE_ANCHOR_SIZE_LIST = [32, 64, 128, 256, 512] | ||
ANCHOR_STRIDE = [8, 16, 32, 64, 128] | ||
ANCHOR_SCALES = [2 ** 0, 2 ** (1.0 / 3.0), 2 ** (2.0 / 3.0)] | ||
ANCHOR_RATIOS = [0.5, 1.0, 2.0] | ||
ANCHOR_SCALE_FACTORS = None | ||
USE_CENTER_OFFSET = True | ||
|
||
# --------------------------------------------RPN config | ||
SHARE_NET = True | ||
USE_P5 = True | ||
IOU_POSITIVE_THRESHOLD = 0.5 | ||
IOU_NEGATIVE_THRESHOLD = 0.4 | ||
|
||
NMS = True | ||
NMS_IOU_THRESHOLD = 0.5 | ||
MAXIMUM_DETECTIONS = 100 | ||
FILTERED_SCORE = 0.05 | ||
VIS_SCORE = 0.5 | ||
|
||
|
Oops, something went wrong.