Utils.py 文件源码

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

项目:ISLES2017 作者: MiguelMonteiro 项目源码 文件源码
def adjust_prediction(self, prediction):

        new_prediction = prediction

        labeled, n_objects = ndimage.label(prediction > 0)

        max_volume = 0

        volumes = {}

        for object_n in range(1, n_objects + 1):
            volume = np.sum(prediction[labeled == object_n])
            if volume > max_volume:
                max_volume = volume
            volumes.update({object_n: volume})

        for object_n, volume in volumes.iteritems():
            if volume < self.threshold * max_volume:
                new_prediction[labeled == object_n] = 0
        return new_prediction
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号