inception_model.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:sea-lion-counter 作者: rdinse 项目源码 文件源码
def generateCountMaps(self, coords):
    '''Generates a count map for the provided list of coordinates.
    '''

    s = self.config['projective_field_size']
    unpadded_size = self.config['output_size']
    target_size = 3 + unpadded_size + 2 * s 
    countMaps = np.zeros((self.config['cls_nb'], target_size, target_size), dtype=np.int16)

    for coord in coords:
      y = coord[1] - self.config['contextual_pad']
      x = coord[2] - self.config['contextual_pad']
      if y >= 0 and y < self.config['tile_size'] and \
         x >= 0 and x < self.config['tile_size']:

        self.inc_region(countMaps[coord[0]], *self.target_sizes[y, x])

    return np.moveaxis(countMaps, 0, -1).astype(np.float32)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号