コードの解釈マスク-rcnn(IV):プロセスデータrpn_feature_maps

ここで、アナログデータ処理、最終的に得られるrpn_class_logits、rpn_class、rpn_bboxをrpn_feature_maps。

コードは以下の通りであります:

AS NP numpyのインポート
「」「
中間変数HとW、シミュレーションとほぼ矛盾層間の場合二つの層、4〜8の各
」「」
例えばP3として層#シミュレーション、
A1 = np.ones( (3,8,2))#rpn_class_logits
B1 = np.ones((3,8,2))#rpn_class
C1 = np.ones((3,8,4))#1 rpn_bboxの
層のため#シミュレーションなどP4
A2 np.ones =((3,4,2))#rpn_class_logits
B2 = np.ones((3,4,2))#rpn_class
C2 = np.ones((3,4,4-))#rpn_bbox
layer_outputs = [ ]
'' '
ここで、以下のシミュレーションコード、layer_outputsを得た:
Pためrpn_feature_mapsで:
layer_outputs.append(RPN([P]))
' ''
D1 = [A1、B1、C1]
D2 = [A2、B2、C2]
layer_outputs.append(D1)
layer_outputs.append(D2)
'' '
出力=リスト(ZIP(* layer_outputs))
' ''
output_names = [ "rpn_class_logits"、 "rpn_class"、 "rpn_bbox"]#可跳过
出力=リスト(ZIP(* layer_outputs))
プリント( '出力'、出力
''」
此处模拟以下代码、最终得到rpn_class_logits、 rpn_class、rpn_bbox值
出力= [KL.Concatenate(軸= 1、名前= N)(リスト(O))Oのために、N ZIPに(出力、output_names)]
''」
rpn_class_logits = np.concatenate((リスト(出力[0])[0]、リスト(出力[0])[1])、軸= 1)
プリント( 'rpn_class_logits ='、rpn_class_logits)
rpn_class = np.concatenate((リスト(出力[1])[0] 、リスト(出力[1])[1])、軸= 1)
プリント( 'rpn_class ='、rpn_class)
rpn_bbox = np.concatenate((リスト(出力[2])[0]、リスト(出力[2] )[1])、軸= 1)
プリント( 'rpn_bbox ='、rpn_bbox)


結果は以下の通りであります:

出力[(配列([[[1、1]、
[1、1]、
[1、1]、
[1、1]、
[1、1]、
[1。 、1]、
[1、1]、
[1、1]]、

[1、1]、
[1、1]、
[1、1]、
[1、1]、
[1、1]、
[1、1]、
[ 1、1]、
[1、1]]、

[1、1]、
[1、1]、
[1、1]、
[1、1]、
[1、1]、
[1、1]、
[ 1、1]、
[1、1]]])、アレイ([[[1、1]、
[1、1]、
[1、1]、
[1、 1]]、

[1、1]、
[1、1]、
[1、1]、
[1、1]]、

[1、1]、
[1、1]、
[1、1]、
[1、1]]]))、(配列([[[1、1]
[1、1]、
[1、1]、
[1、1]、
[1、1]、
[1、1]、
[1、1]、
[1 。、1]]、

[1、1]、
[1、1]、
[1、1]、
[1、1]、
[1、1]、
[1、1]、
[ 1、1]、
[1、1]]、

[1、1]、
[1、1]、
[1、1]、
[1、1]、
[1、1]、
[1、1]、
[ 1、1]、
[1、1]]])、アレイ([[[1、1]、
[1、1]、
[1、1]、
[1、 1]]、

[1、1]、
[1、1]、
[1、1]、
[1、1]]、

[1、1]、
[1、1]、
[1、1]、
[1、1]]]))、(配列([[[1、1、1 。、1]、
[1、1、1、1]、
[1、1、1、1]、
[1、1、1、1]、
[1 。、1、1、1]、
[1、1、1、1]、
[1、1、1、1]、
[1、1、1、 1]]、

[1、1、1、1]、
[1、1、1、1]、
[1、1、1、1]、
[1、1、 1、1]、
[1、1、1、1]、
[1、1、1、1]、
[1、1、1、1]、
[ 1、1、1、1]]、

[1、1、1、1]、
[1、1、1、1]、
[1、1、1、1]、
[1、1、 1、1]、
[1、1、1、1]、
[1、1、1、1]、
[1、1、1、1]、
[ 1、1、1、1]]])、アレイ([[[1、1、1、1]、
[1、1、1、1]、
[1 。、1、1、1]、
[1、1、1、1]]、

[1、1、1、1]、
[1、1、1、1]、
[1、1、1、1]、
[1、1、 1、1]]、

[1、1、1、1]、
[1、1、1、1]、
[1、1、1、1]、
[1、1、 1、1]]]))]
rpn_class_logits =(配列([[[1、1]、
[1、1]、
[1、1]、
[1、1]
[1、1]、
[1、1]、
[1、1]、
[1、1]]、

[1、1]、
[1、1]、
[1、1]、
[1、1]、
[1、1]、
[1、1]、
[ 1、1]、
[1、1]]、

[1、1]、
[1、1]、
[1、1]、
[1、1]、
[1、1]、
[1、1]、
[ 1、1]、
[1、1]]])、アレイ([[[1、1]、
[1、1]、
[1、1]、
[1、 1]]、

[1、1]、
[1、1]、
[1、1]、
[1、1]]、

[1、1]、
[1、1]、
[1、1]、
[1、1]]]))
rpn_class =(配列([[[1、1]
[1、1]、
[1、1]、
[1、1]、
[1、1]、
[1、1]、
[1、1]、
[ 1、1]]、

[1、1]、
[1、1]、
[1、1]、
[1、1]、
[1、1]、
[1、1]、
[ 1、1]、
[1、1]]、

[1、1]、
[1、1]、
[1、1]、
[1、1]、
[1、1]、
[1、1]、
[ 1、1]、
[1、1]]])、アレイ([[[1、1]、
[1、1]、
[1、1]、
[1、 1]]、

[1、1]、
[1、1]、
[1、1]、
[1、1]]、

[1、1]、
[1、1]、
[1、1]、
[1、1]]]))
rpn_bbox =(配列([[[1、1、 1、1]、
[1、1、1、1]、
[1、1、1、1]、
[1、1、1、1]、
[ 1、1、1、1]、
[1、1、1、1]、
[1、1、1、1]、
[1、1、1。 、1]]、

[1、1、1、1]、
[1、1、1、1]、
[1、1、1、1]、
[1、1、 1、1]、
[1、1、1、1]、
[1、1、1、1]、
[1、1、1、1]、
[ 1、1、1、1]]、

[1、1、1、1]、
[1、1、1、1]、
[1、1、1、1]、
[1、1、 1、1]、
[1、1、1、1]、
[1、1、1、1]、
[1、1、1、1]、
[ 1、1、1、1]]])、アレイ([[[1、1、1、1]、
[1、1、1、1]、
[1 。、1、1、1]、
[1、1、1、1]]、

[1、1、1、1]、
[1、1、1、1]、
[1、1、1、1]、
[1、1、 1、1]]、

[1、1、1、1]、
[1、1、1、1]、
[1、1、1、1]、
[1、1、 1、1]]]))
rpn_bbox = [[[1。1. 1. 1]
[1。1. 1. 1]
[1。1. 1. 1]
[1。1. 1. 1]
[1。1. 1. 1]
[1。1. 1. 1]
[1。1. 1. 1]
[1。1. 1. 1]
[1。1. 1. 1]
[1。1. 1. 1]
[1。1. 1. 1]
[1。1. 1. 1]]

[[1。1. 1. 1]
[1。1. 1. 1]
[1。1. 1. 1]
[1。1. 1. 1]
[1。1. 1. 1]
[1。1. 1. 1]
[1。1. 1. 1]
[1。1. 1. 1]
[1。1. 1. 1]
[1。1. 1. 1]
[1。1. 1. 1]
[1。1. 1. 1]]

[[1。1. 1. 1]
[1。1. 1. 1]
[1。1. 1. 1]
[1。1. 1. 1]
[1。1. 1. 1]
[1。1. 1. 1]
[1。1. 1. 1]
[1。1. 1. 1]
[1。1. 1. 1]
[1。1. 1. 1]
[1。1. 1. 1]
[1。1. 1. 1]]]





おすすめ

転載: www.cnblogs.com/tangjunjun/p/11966802.html