实现Faster R-CNN的keras代码理解(二)-配置文件解析

xiaoxiao2025-07-16  10

 

该章节主要介绍配置文件的构成,包括:

1、网络的选取   2、是否进行数据增强  3、anchor_box中scales以及ratios  4、Rois的个数  5、分类检测的over_laps的确定

from keras import backend as K import math class Config: def __init__(self): self.verbose=True; self.network='resnet50' ##setting for data agumentation self.use_horizontal_flips=False self.use_verticle_flips=False self.ro_90=False #anchor box scales self.anchor_box_scales=[128,256,512] #anchor box ratios self.anchor_box_ratios=[[1,1],[1./math.sqrt(2),2./math.sqrt(2)],[2./math.sqrt(2),1./math.sqrt(2)]] #size to resize the smallest side of the image self.im_size=600 #image channel-wise mean to subtract#?? self.img_channel_mean=[103.939, 116.779, 123.68] self.img_scaling_factor=1.0 # number of ROIs at once self.num_rois=4 # stride at the RPN (this depends on the network configuration) self.rpn_stride = 16 self.balanced_classes = False # scaling the stdev self.std_scaling = 4.0#?? self.classifier_regr_std = [8.0, 8.0, 4.0, 4.0]#?? # overlaps for RPN self.rpn_min_overlap = 0.3 self.rpn_max_overlap = 0.7 # overlaps for classifier ROIs self.classifier_min_overlap = 0.1 self.classifier_max_overlap = 0.5 # placeholder for the class mapping, automatically generated by the parser self.class_mapping = None

 

转载请注明原文地址: https://www.6miu.com/read-5033185.html

最新回复(0)