Downloads · 30 days
0
amd/ryzenai-hrnet-bg-seg
ryzenai-hrnet-bg-seg is a image segmentation model from amd. Use it for the image segmentation task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
The model operating at 512x512 resolution for semantic background segmentation on images.
Downloads · 30 days
0
Access
Public
Updated Jan 21, 2026
Repo size
330 MB
Likes
0
Public
Click a slice to open those files.
.onnx330 MB · 100%
From the Hugging Face model README
The model operating at 512x512 resolution for semantic background segmentation on images.
It was introduced in the paper Object-Contextual Representations for Semantic Segmentation by Yuhui Yuan et al.
We have developed a modified version optimized for AMD Ryzen AI.
HRNet is an advanced deep learning architecture designed for image segmentation tasks. It maintains high-resolution representations throughout the network, enabling precise semantic segmentation with accurate spatial details.
You can use this model for background segmentation tasks. See the model hub for all available hrnet-bg-seg models.
# inference only
pip install -r requirements-infer.txt
# inference & evaluation
pip install -r requirements-eval.txt
Run python download_dut_omron.py to automatically download and extract the DUT-OMRON dataset into the datasets directory.
Alternatively, you can manually download DUT-OMRON Dataset Images and Pixel-wise Ground Truth from the DUT-OMRON page, then extract both archives into datasets.
Your datasets folder should look like this:
datasets
├── DUT-OMRON-image
│ ├── im005.jpg
│ ├── ...
└── pixelwiseGT-new-PNG
├── im005.png
├── ...
python onnx_inference.py --onnx seg_hrnet_nchw_u8s8.onnx --input /Path/To/Your/Image --out-dir outputs
Arguments:
--input: Accepts either a single image file path or a directory path. If it's a file, the script will process that image only. If it's a directory, the script will recursively scan for .png, .jpg, and .jpeg files and process all of them.
--out-dir: Output directory where the restored images will be saved.
python onnx_eval.py \
--onnx seg_hrnet_nchw_u8s8.onnx \
--img-dir datasets/DUT-OMRON-image \
--gt-mask-dir datasets/pixelwiseGT-new-PNG \
--out-dir outputs/
| Model | MAE(⬇) | s-measure(⬆) | max f-measure(⬆) | weighted f-measure(⬆) |
|---|---|---|---|---|
| HRNet (fp32) | 0.0803 | 0.7586 | 0.6867 | 0.6570 |
| HRNet (u8s8) | 0.0789 | 0.7611 | 0.6892 | 0.6600 |
Note:
DUT-OMRON dataset.@article{YuanCW19,
title={Object-Contextual Representations for Semantic Segmentation},
author={Yuhui Yuan and Xilin Chen and Jingdong Wang},
booktitle={ECCV},
year={2020}
}