def proposal_target_layer(self, input, classes, name):
if isinstance(input[0], tuple):
input[0] = input[0][0]
with tf.variable_scope(name) as scope:
# (Yuliang)
rois,labels,eye,smile,bbox_targets,bbox_inside_weights,bbox_outside_weights = tf.py_func(proposal_target_layer_py,[input[0],input[1],classes],[tf.float32,tf.float32,tf.float32,tf.float32,tf.float32,tf.float32,tf.float32])
rois = tf.reshape(rois,[-1,5] , name = 'rois')
labels = tf.convert_to_tensor(tf.cast(labels,tf.int32), name = 'labels')
# (Yuliang)
eye = tf.convert_to_tensor(tf.cast(eye,tf.int32), name = 'eye')
smile = tf.convert_to_tensor(tf.cast(smile,tf.int32), name = 'smile')
bbox_targets = tf.convert_to_tensor(bbox_targets, name = 'bbox_targets')
bbox_inside_weights = tf.convert_to_tensor(bbox_inside_weights, name = 'bbox_inside_weights')
bbox_outside_weights = tf.convert_to_tensor(bbox_outside_weights, name = 'bbox_outside_weights')
# (Yuliang)
return rois, labels, eye, smile, bbox_targets, bbox_inside_weights, bbox_outside_weights
# return rois, labels, bbox_targets, bbox_inside_weights, bbox_outside_weights
# (Yuliang)
# Since we have 2 more outputs in proposal_target_layer, we now want to
# exclude them so that we can feed into the roi_pooling layer
network.py 文件源码
python
阅读 43
收藏 0
点赞 0
评论 0
评论列表
文章目录