AVOD-代码理解
从输入到数据融合之前
def build(self):
# Setup input placeholders
# 一堆的输入信息.就是给输入占个坑
self._set_up_input_pls()
# Setup feature extractors
# 输入图像的featuremap
self._set_up_feature_extractors()
# proposal_input
# 1*1卷积后的bev_fasturemap和img_featuremap
bev_proposal_input = self.bev_bottleneck
img_proposal_input = self.img_bottleneck
# 融合参数
fusion_mean_div_factor = 2.0
# If both img and bev probabilites are set to 1.0, don't do
# path drop.如果image和bev概率都设置为1.0,则不要执行路径丢弃。
#train=0.9,test/val=1.0
#ture!
if not (self._path_drop_probabilities[0] ==
self._path_drop_probabilities[1] == 1.0):
with tf.variable_scope('rpn_path_drop'):
#从均匀分布中输出随机值。.随机输出3个0-1之间的数
random_values = tf.random_uniform(shape=[3],
minval=0.0,
maxval=1.0)
#0.9,0.9.
#不是零就是1
img_mask, bev_mask = self.create_path_drop_masks(
self._path_drop_probabilities[0],
self._path_drop_probabilities[1],
random_values)
#选择是否输入.如果mask为1 ,则输入,否则不输入
img_proposal_input = tf.multiply(img_proposal_input,
img_mask)
bev_proposal_input = tf.multiply(bev_proposal_input,
bev_mask)
self.img_path_drop_mask = img_mask
self.bev_path_drop_mask = bev_mask
# Overwrite the division factor
#在训练时的融合参数
fusion_mean_div_factor = img_mask + bev_mask
#bev和iname的featuremap的裁剪
with tf.variable_scope('proposal_roi_pooling'):
with tf.variable_scope('box_indices'):
'''有点复杂'''
def get_box_indices(boxes):
#list列表.[1,2,3...]
#看不懂