HybridNets
An Efficient Model for Fusion of Target Detection and Image Segmentation --HybridNets
Install / Use
/learn @JJASMINE22/HybridNetsREADME
HybridNets目标检测与图像分割融合模型 –Pytorch实现
目录
- 所需环境 Environment
- 注意事项 Attention
- 模型结构 Network Structure
- 效果展示 Effect
- 数据下载 Download
- 训练步骤 Train
- 预测步骤 Predict
- 参考文献 Reference
所需环境
- Python3.7
- Pytorch>=1.10.1+cu113
- Torchvision>=0.11.2+cu113
- timm>=0.6.11
- Tensorflow>=2.5.0(非必须)
- Tensorflow-gpu>=2.5.0(非必须)
- Numpy==1.19.5
- Pillow==8.2.0
- Opencv-contrib-python==4.5.1.48
- onnx==1.12.0
- onnx-tf==1.10.0(非必须)
- onnxruntime==1.12.1
- onnxruntime-gpu==1.12.1
- CUDA 11.0+
- Cudnn 8.0.4+
- Docker(非必须)
注意事项
- 实现基于effecientnet骨干的HybridNets,用于检测目标,同时分割关键区域 2.真实框与先验框的标签整定使用借鉴Retina/RetinaFace,https://github.com/biubug6/Pytorch_Retinaface
- 借鉴RetinaFace的检测体置信度、坐标位置误差计算方法
- 图像分割误差直接使用BCE误差,为避免过拟合可更换为Focal误差
- 加入正则化操作,降低过拟合影响
- 数据与标签路径、训练参数等均位于config.py
- onnx通用部署模型转换位于
./onnx
- tensorflow pb模型需执行
onnx2pb.py
- 产出pb模型,tensorflow serving部署指令:
docker run -p 8501:8501 -p 8500:8500 --mount type=bind,source=根目录/pb_model/hybridnet,target=/models/hybridnet -e MODEL_NAME= hybridnet -t tensorflow/serving:版本
- 本项目提供的pb模型较弱,训练次数较少,仅供参考
模型结构

效果展示


数据下载
BDD100K
链接:https://bdd-data.berkeley.edu/portal.html#download
下载解压后将数据集放置于config.py中指定的路径。
训练步骤
运行train.py
预测步骤
运行predict.py
参考文献
https://arxiv.org/abs/2203.09035
Related Skills
node-connect
348.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
348.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
348.5kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
