百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
D

DeepLabV3Plus-Pytorch

> DevOps
开源

针对 Pascal VOC 和 Cityscapes 的预训练的 DeepLabv3 和 DeepLabv3+

2.7K stars0 点赞2 次浏览
访问官网GitHub

工具介绍

针对 Pascal VOC 和 Cityscapes 的预训练的 DeepLabv3 和 DeepLabv3+

DeepLabv3Plus-Pytorch

预训练的DeepLabv3、DeepLabv3+,用于Pascal VOC和Cityscapes数据集。

快速开始

1. 可用架构

DeepLabV3 DeepLabV3+
deeplabv3_resnet50 deeplabv3plus_resnet50
deeplabv3_resnet101 deeplabv3plus_resnet101
deeplabv3_mobilenet deeplabv3plus_mobilenet
deeplabv3_hrnetv2_48 deeplabv3plus_hrnetv2_48
deeplabv3_hrnetv2_32 deeplabv3plus_hrnetv2_32
deeplabv3_xception deeplabv3plus_xception
请参阅 network/modeling.py 以获取所有模型条目。
下载预训练模型:Dropbox、Tencent 微云

注意:HRNet 骨干网络由 @timothylimyl 贡献。预训练骨干网络可在 Google Drive 获取。

2. 加载预训练模型:

python
model = network.modeling.__dict__[MODEL_NAME](num_classes=NUM_CLASSES, output_stride=OUTPUT_SRTIDE)
model.load_state_dict( torch.load( PATH_TO_PTH )['model_state']  )

3. 可视化分割输出:

python
outputs = model(images)
preds = outputs.max(1)[1].detach().cpu().numpy()
colorized_preds = val_dst.decode_target(preds).astype('uint8') # To RGB images, (N, H, W, 3), ranged 0~255, numpy array
# Do whatever you like here with the colorized segmentation maps
colorized_preds = Image.fromarray(colorized_preds[0]) # to PIL Image

4. 空洞可分离卷积

注意:本仓库中的所有预训练模型均未使用空洞可分离卷积进行训练。

本仓库支持空洞可分离卷积。我们提供了一个简单工具 network.convert_to_separable_conv,用于将 nn.Conv2d 转换为 AtrousSeparableConvolution。如需使用,请在运行 main.py 时加上 '--separable_conv' 参数。更多详情请参阅 'main.py' 和 'network/_deeplab.py'。

5. 预测

单张图像:

bash
Python predict.py --input datasets/data/cityscapes/leftImg8bit/train/bremen/bremen_000000_000019_leftImg8bit.png  --dataset cityscap

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Pythoncityscapesdeeplabv3deeplabv3pluspascal-voc

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类DevOps
定价开源

> 相关工具

D
Docker
容器化平台,标准化应用交付
G
GitHub Actions
GitHub 原生 CI/CD 工作流
N
Nginx
高性能 Web 服务器与反向代理