我们在运行代码中发现,头文件如下代码
import surface_distance
from surface_distance import metrics
ssd = surface_distance.compute_surface_distances((seg == 1)[0, 0].cpu().numpy(),
(masks==1)[0, 0].cpu().numpy(),
spacing_mm=spacing[0].numpy())
nsd = metrics.compute_surface_dice_at_tolerance(ssd, args.tolerance)
直接运行会报错,需要安装库
我们直接查询到github的链接
https://github.com/google-deepmind/surface-distance
直接按照github链接安装
git clone https://github.com/deepmind/surface-distance.git
pip install surface-distance/
报错:fatal: destination path 'surface-distance' already exists and is not an empty directory.
这时候需要设置网络代理
在cmd命令行中输入
git config --global http.proxy http://127.0.0.1:7890
再次按照github链接安装
git clone https://github.com/deepmind/surface-distance.git
pip install surface-distance/
就可以成功装上库!!
再次调用头文件就不会报错