def generateCountMaps(self, coords):
'''Generates a count map for the provided list of coordinates.
'''
s = self.config['projective_field_size']
target_size = 3 + self.config['output_size'] + 2 * s
count_maps = np.zeros((self.config['cls_nb'], target_size, target_size), dtype=np.int16)
shift = - self.config['contextual_pad']
size = self.config['tile_size']
for coord in coords:
y = coord[1] + shift
x = coord[2] + shift
if y >= 0 and y < size and \
x >= 0 and x < size:
self.inc_region(count_maps[coord[0]], *self.target_sizes[y, x])
return np.moveaxis(count_maps, 0, -1).astype(np.float32)
contextual_inception_model.py 文件源码
python
阅读 32
收藏 0
点赞 0
评论 0
评论列表
文章目录