参考链接:https://gitee.com/dogeblog/unet#%E4%BB%8B%E7%BB%8D
防止失效,以下记录:
介绍
基于unet的语义分割。 包括标注,标注结果转训练集,数据集训练,训练结束后转tensorrt,tensorrt客户端部署。
tensorrt部署后,640*360的图,在rtx3090推理时间4-5ms
原始代码来源
unet代码源于https://github.com/milesial/Pytorch-UNet
tensorrt代码源于https://github.com/wang-xinyu/tensorrtx 与 https://github.com/YuzhouPeng/unet-tensorrt
1.标注
参考https://gitee.com/doge_ac_cn/labelme#installation
2.生成unet训练的数据集
1.先把labelme标注的结果放在 labelme绘制mask/labelme 文件夹下。
2.然后先后运行labelme2coco.py和genneratemask.py,分别生成coco标注文件和mask文件。
3.训练
1.把原图和mask分别拷贝到 Pytorch-UNet/data 的img和mask文件夹下
2.运行train.py
3.命令行输入tensorboard --logdir=runs
然后进入h