basic_model.py 文件源码

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

项目:sea-lion-counter 作者: rdinse 项目源码 文件源码
def inc_region(self, dst, y, x, h, w):
    '''Incremets dst in the specified region. Runs fastest on np.int8, but not much slower on
    np.int16.'''

    dh, dw = dst.shape
    h2 = h // 2
    w2 = w // 2
    py = y - h2 
    px = x - w2 
    y_min = max(0, py)
    y_max = min(dh, y + h2)
    x_min = max(0, px)
    x_max = min(dw, x + w2)
    if y_max - y_min <= 0 or x_max - x_min <= 0:
      return

    dst[y_min:y_max, x_min:x_max] += 1
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号