sealiondata.py 文件源码

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

项目:sealionengine 作者: gecrooks 项目源码 文件源码
def load_train_image(self, train_id, scale=1, border=0, mask=False):
        """Return image as numpy array.

        Args:
            border (int): Add a black border of this width around image
            mask (bool): If true copy masks from corresponding dotted image

        Returns:
            uint8 numpy array
        """
        img = self._load_image('train', train_id, scale, border)
        if mask:
            # The masked areas are not uniformly black, presumable due to
            # jpeg compression artifacts
            MASK_MAX = 40
            dot_img = self.load_dotted_image(train_id, scale, border).astype(np.uint16).sum(axis=-1)
            img = np.copy(img)
            img[dot_img < MASK_MAX] = 0
        return img
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号