Home ONNX HAWP Line Detection
Post
Cancel

Open In GithubOpen In Github

Python scripts for performing line detection using the HAWP model in ONNX.

!ONNX HAWP Line Detection

Original image: https://commons.wikimedia.org/wiki/File:Bedroom_Mitcham.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

1
2
3
git clone https://github.com/ibaiGorordo/ONNX-HAWP-Line-Detection.git --recursive
cd ONNX-HAWP-Line-Detection
pip install -r requirements.txt

ONNX Runtime

For Nvidia GPU computers: pip install onnxruntime-gpu

Otherwise: pip install onnxruntime

For youtube video inference

1
2
pip install youtube_dl
pip install git+[https://github.com/zizo-pro/pafy@b8976f22c19e4ab5515cacbfae0a3970370c102b](https://github.com/zizo-pro/pafy@b8976f22c19e4ab5515cacbfae0a3970370c102b)

ONNX model

The original model was converted to different formats (including .onnx) by PINTO0309. Download the model from his repository using the download script and save them into the models folder

Examples

  • Image Line Detection:
    1
    
     python image_line_detection.py
    
  • Webcam Line Detection:
    1
    
     python webcam_line_detection.py
    
  • Video Line Detection: https://youtu.be/AKdwQwBCaTk
    1
    
     python video_line_detection.py
    

    !HAWP Video Line Detection

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

References:

This post is licensed under CC BY 4.0 by the author.