Skip to content

Python scripts performing semantic segmentation using the TopFormer model in ONNX.

License

Notifications You must be signed in to change notification settings

ibaiGorordo/ONNX-TopFormer-Semantic-Segmentation

Repository files navigation

ONNX TopFormer Semantic Segmentation

Python scripts performing semantic segmentation using the TopFormer model in ONNX.

!TopFormer Semantic Segmentation Original image: https://en.wikipedia.org/wiki/File:Beatles_-_Abbey_Road.jpg

Requirements

  • Check the requirements.txt file.
  • For ONNX, if you have a NVIDIA GPU, then install the onnxruntime-gpu, otherwise use the onnxruntime library.
  • Additionally, pafy and youtube-dl are required for youtube video inference.

Installation

git clone https://github.com/ibaiGorordo/ONNX-TopFormer-Semantic-Segmentation.git
cd ONNX-TopFormer-Semantic-Segmentation
pip install -r requirements.txt

ONNX Runtime

For Nvidia GPU computers: pip install onnxruntime-gpu

Otherwise: pip install onnxruntime

For youtube video inference

pip install youtube_dl
pip install git+https://github.com/zizo-pro/pafy@b8976f22c19e4ab5515cacbfae0a3970370c102b

ONNX model

The model was converted from the Pytorch implementation using the code in the original repository. Download the converted ONNX model from the drive file and save them into the models folder.

Pytorch model

The original Pytorch model can be found in this repository: https://github.com/hustvl/TopFormer

Examples

  • Image inference:
python image_semantic_segmentation.py
  • Webcam inference:
python webcam_semantic_segmentation.py
python video_semantic_segmentation.py

!CREStereo depth estimation

Original video: https://youtu.be/yWHdkK5j4yk

References:

About

Python scripts performing semantic segmentation using the TopFormer model in ONNX.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages