|
沙发
楼主 |
发表于 2019-4-11 13:32:55
|
只看该作者
解决方法:
在 tensorflow\models\research\object_detection\meta_architectures\ssd_meta_arch.py
predictions_dict = {
'preprocessed_inputs': preprocessed_inputs,
'feature_maps': feature_maps,
'anchors': self._anchors.get()
} 代码后添加以下代码:
sess = tf.Session()
with sess.as_default():
anchors_np = self._anchors.get().eval()
anchors_np = anchors_np.transpose()
minx = anchors_np[0]
miny = anchors_np[1]
maxx = anchors_np[2]
maxy = anchors_np[3]
cx = (minx + maxx) / 2.
cy = (miny + maxy) / 2.
w = maxx - minx
h = maxy - miny
np.savetxt('box_priors.txt', (cx, cy, w, h), fmt='%0.8f')
即可保存 box_priors.txt 文件
|
|