ONNX Model Zoo

amd/HRNet

By amd · ↓ 0 · ♥ 3 · Updated 2024-01-09

What's in this repo

This page lists the files in amd/HRNet, including HighResolutionNet_int.onnx.

  • 1 ONNX models (.onnx files)
  • 12 files, including 3 .lst, 3 .py, 1 .onnx, 1 .md, 1 .png, 1 .txt
  • Last updated 2024-01-09

ONNX files

File Size Download
HighResolutionNet_int.onnx — Download

How to use

These ONNX files can be loaded with ONNX Runtime. To inspect a model graph, upload the file to the Netron viewer. Download links point to the original files on Hugging Face.

README

HRNet model trained on Cityscapes

HRNet trained on Cityscapes dataset at resolution 512x1024 for semantic segmentation on images. It was introduced in the paper Segmentation Transformer: Object-Contextual Representations for Semantic Segmentation by Yuhui Yuan et al. The code version we use from this repository.

We develop a modified version that could be supported by AMD Ryzen AI.

Model description

HRNet is an advanced algorithm used for image segmentation. It is based on deep learning techniques and is capable of providing accurate semantic segmentation in images.

Intended uses & limitations

You can use the raw model for semantic segmentation. See the model hub to look for all available HRNet models.

How to use

Installation

Follow Ryzen AI Installation to prepare the environment for Ryzen AI. Run the following script to install pre-requisites for this model.

pip install -r requirements.txt 

Data Preparation (optional: for accuracy evaluation)

  1. Download the Cityscapes dataset, which includes images and annotations. Download gtFine_trainvaltest.zip (241MB) and leftImg8bit_trainvaltest.zip (11GB).
  2. Organise the dataset directory as follows:
  ./data/cityscapes/
    gtFine
    leftImg8bit
    train.lst
    val.lst
    test.lst

Test & Evaluation

  • Run inference on a single image
python hrnet_quantized_onnx_inference.py -m HighResolutionNet_int.onnx -idir PATH_TO_IMAGES(like .\data\cityscapes\leftImg8bit\val\frankfurt) --ipu --provider_config Path\To\vaip_config.json
#return segmentaion logits and can visualize the result.

Note: vaip_config.json is located at the setup package of Ryzen AI (refer to Installation)

  • Test accuracy of the quantized model on Cityscapes.
python hrnet_quantized_onnx_eval.py -m .\HighResolutionNet_int.onnx -r .\data\cityscapes -l .\val.lst --ipu --provider_config .\vaip_config.json

Performance

Model miou
HRNet_int8_onnx_model (512x1024) 72.31%
@article{YuanCW19,
  title={Object-Contextual Representations for Semantic Segmentation},
  author={Yuhui Yuan and Xilin Chen and Jingdong Wang},
  booktitle={ECCV},
  year={2020}
}

Model info

onnx Image Segmentation Semantic Segmentation Computer Vision Cityscapes HRNet ONNX Int8 quantization RyzenAI image-segmentation en dataset:Chris1/cityscapes
↓ 0 ♥ 3

Created: 2023-12-04

Updated: 2024-01-09

View on Hugging Face

Files (12)

.gitattributes
HighResolutionNet_int.onnx ONNX
README.md
color_.png
data/.DS_Store
data/cityscapes/test.lst
data/cityscapes/train.lst
data/cityscapes/val.lst
hrnet_quantized_onnx_eval.py
hrnet_quantized_onnx_inference.py
requirements.txt
utils.py

Related models