一、简介
当我们评价图像分割的质量和模型表现时,经常会用到各类表面距离的计算。这里推荐一个deepmind的表面距离度量计算库surface-distance。
surface-distancegithub.com这个库主要包含了以下几个表面距离计算:
- Average surface distance 平均表面距离
- Hausdorff distance 豪斯多夫距离
- Surface overlap 表面重叠度
- Surface dice 表面dice值
- Volumetric dice 三维dice值
二、安装
git clone https://github.com/deepmind/surface-distance.git
cd surface-distance
修改surface_distance文件夹下的__init__.py文件中的第16行
from metrics import *
改为
from .metrics import *
然后
pip install .
为了测试是否安装成功, 运行
python surface_distance_test.py
如果出现下面的输出说明安装成功
[ RUN ] SurfaceDistanceTest.testEmptyGroundTruthMask
[ OK ] SurfaceDistanceTest.testEmptyGroundTruthMask
[ RUN ] SurfaceDistanceTest.testEmptyPredictionMask
[ OK ] SurfaceDistanc