from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import os.path as osp
import numpy as np
# `pip install easydict` if you don't have it
from easydict import EasyDict as edict
__C = edict()
# Consumers can get config by:
# from fast_rcnn_config import cfg
cfg = __C
#
# Training options
#
# 创建一个easydict的字典,可以以属性的方式访问字典,方便使用
__C.TRAIN = edict()
# Initial learning rate
# 相当于添加字典键值对 {LEARNING_RATE:0.001} 下同
__C.TRAIN.LEARNING_RATE = 0.001
# Momentum
__C.TRAIN.MOMENTUM = 0.9
# Weight decay, for regularization
__C.TRAIN.WEIGHT_DECAY = 0.0001
# Factor for reducing the learning rate
# 每次学习速率降低为原来的十分之一
__C.TRAIN.GAMMA = 0.1
# Step size for reducing the learning rate, currently only support one step
# 每迭代stepsize次,学习速率降低一次
__C.TRAIN.STEPSIZE = [30000]
# Iteration intervals for showing the loss during training, on command line interface
# 每10个iter展示一次训练情况,包括loss,lr等
__C.TRAIN.DISPLAY = 10
# Whether to double the learning rate for bias
__C.TRAIN.DOUBLE_BIAS = True
# Whether to initialize the weights with truncated normal distribution
__C.TRAIN.TRUNCATED = False
# Whether to have weight decay on bias as well
__C.TRAIN.BIAS_DECAY = False
# Whether to add ground truth boxes to the pool when sampling regions
# 是否把gt_boxes也加入到rpn产生的候选区域中,用于训练
__C.TRAIN.USE_GT = False
# Whether to use aspect-ratio grouping of training images, introduced merely for saving
# GPU memory
# 是否使用长宽比对训练图像进行分组
__C.TRAIN.ASPECT_GROUPING = False
# The number of snapshots kept, older ones are deleted to save space
# 模型快照pkl保存的最大数量
__C.TRAIN.SNAPSHOT_KEPT = 3
# The time interval for saving tensorflow summaries
# 保存摘要的时间间隔,单位秒
__C.TRAIN.SUMMARY_INTERVAL = 180
# Scale to use during training (can list multiple scales)
# The scale is the pixel size of an image's shortest side
# 将最短边缩放到600
__C.TRAIN.SCALES = (600,)
# Max pixel size of the longest side of a scaled input image
# 如果缩放后最长边超过1000,则再次缩放,将最长边缩放到1000
__C.TRAIN.MAX_SIZE = 1000
# Images to use per minibatch
# 训练RPN网络时的batch_size
__C.TRAIN.IMS_PER_BATCH = 1
# Minibatch size (number of regions of interest [ROIs])
# 每张图片经过RPN产生的候选区域中用于训练RCNN的数量(训练RCNN部分的batch_size)
__C.TRAIN.BATCH_SIZE = 128
# Fraction of minibatch that is labeled foreground (i.e. class > 0)
# 一张图片经过RPN产生的候选区域中用于训练RCNN的前景的最大占比
__C.TRAIN.FG_FRACTION = 0.25
# Overlap threshold for a ROI to be considered foreground (if >= FG_THRESH)
# 大于阈值的rpn候选区域判断为前景
__C.TRAIN.FG_THRESH = 0.5
# Overlap threshold for a ROI to be conside
Faster Rcnn 代码解读之 config.py
最新推荐文章于 2021-10-28 23:08:27 发布