希望找一些小伙伴,共同研究nnunetv2版代码,有意者请私聊。!!!!!!!!!!!
以下步骤推荐在linux平台下操作,bilibili地址:【你要的nnunetv1实操来了】https://www.bilibili.com/video/BV1n94y1t76n?vd_source=a4bd8a5276d0156f1f19e2e9eb9d9519
1、从git上下载源代码
https://github.com/MIC-DKFZ/nnUNet
2、下载开源数据集
https://drive.google.com/drive/folders/1HqEgzS8BV2c7xYNrZdEAnrHk7osJJ--2
3、配置环境
install_requires=[
"torch>1.10.0",
"tqdm",
"dicom2nifti",
"scikit-image>=0.14",
"medpy",
"scipy",
"batchgenerators>=0.23",
"numpy",
"scikit-learn",
"SimpleITK",
"pandas",
"requests",
"nibabel",
"tifffile",
"matplotlib",]
4、建立数据集目录,并将下载的数据放在对应目录下
5、制作数据集json文件(对数据集的情况进行统计)
cd make_dataset.py所在目录
python make_dataset.py(生成datast.json)
6、修改代码
D:\Codes\python\nnUNet-nnunetv1\nnunet\paths.py
base = r'D:\Codes\python\nnUNet-nnunetv1\DATASET\nnUNet_raw'
preprocessing_output_dir = r'D:\Codes\python\nnUNet-nnunetv1\DATASET\nnUNet_preprocessed'
network_training_output_dir_base = r'D:\Codes\python\nnUNet-nnunetv1\DATASET\nnUNet_trained_models'
7、数据集检查
cd nnUNet_convert_decathlon_task.py所在目录
python nnUNet_convert_decathlon_task.py -i D:\Codes\python\nnUNet-nnunetv1\DATASET\nnUNet_raw\nnUNet_raw_data\Task08_HepaticVessel
8、数据预处理
cd nnUNet_plan_and_preprocess.py所在目录
python nnUNet_plan_and_preprocess.py -t 8
9、训练数据
cd run_trainning.py所在目录
python run_training.py 3d_fullres nnUNetTrainerV2 8 4(修改D盘的RAM)
10、使用训练的模型进行推理
cd predict_simple.py所在目录
python predict_simple.py -i D:\Codes\python\nnUNet-nnunetv1\DATASET\nnUNet_raw\nnUNet_raw_data\Task08_HepaticVessel\imagesTs -o D:\Codes\python\nnUNet-nnunetv1\DATASET\nnUNet_raw\nnUNet_raw_data\Task08_HepaticVessel\labelsTs -t 8 -m 3d_fullres -f 4
推荐:https://blog.csdn.net/weixin_42061636/article/details/107719274