sealiondata.py 文件源码

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

项目:sealionengine 作者: gecrooks 项目源码 文件源码
def load_dotted_image(self, train_id, scale=1, border=0, circled=False):
        img = self._load_image('dotted', train_id, scale, border)

        if train_id in self.extra_masks:
            for row, col, radius in self.extra_masks[train_id]:
                rr, cc = skimage.draw.circle(row, col, radius, shape = img.shape)
                img = np.copy(img)
                img[rr, cc] = (0, 0, 0)

        # When dotted image is rotated relative to train, apply hot patch. (kudos: @authman)
        if train_id in self.dotted_rotate:
            rot = self.dotted_rotate[train_id]
            img = np.rot90(img, rot)

        if circled: 
            assert scale == 1
            assert border == 0
            img = np.copy(img)
            img = self.draw_circles(np.copy(img), self.tid_coords[train_id])        

        return img
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号