Skip to content

CGI-Stereo Python Inference Demo

License

Notifications You must be signed in to change notification settings

fateshelled/cgistereo_demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CGI-Stereo Inference DEMO

ONNX and TensorRT inference demo for CGI-Stereo.

Requirements

ONNXRuntime demo

  • OpenCV
  • numpy
  • ONNXRuntime

TensorRT demo

  • OpenCV
  • numpy
  • TensorRT
  • pycuda

Model Download

from PINTO_model_zoo

Usage

ONNXRuntime

usage: demo_onnx.py [-h] [-m MODEL_PATH] [-l LEFT_IMAGE] [-r RIGHT_IMAGE] [-o OUTPUT_PATH]

optional arguments:
  -h, --help            show this help message and exit
  -m MODEL_PATH, --model_path MODEL_PATH
                        ONNX model file path. (default: cgi_stereo_sceneflow_480x640/cgi_stereo_sceneflow_480x640.onnx)
  -l LEFT_IMAGE, --left_image LEFT_IMAGE
                        input left image. (default: data/left.png)
  -r RIGHT_IMAGE, --right_image RIGHT_IMAGE
                        input right image. (default: data/right.png)
  -o OUTPUT_PATH, --output_path OUTPUT_PATH
                        output colored disparity image paht. (default: output.png)

TensorRT

Convert onnx model to tensorrt engine

bash convert_onnx2trt.bash <onnx-model-path> <output-engine-path> 

Inference

usage: demo_trt.py [-h] [-e ENGINE_PATH] [-ih INPUT_HEIGHT] [-iw INPUT_WIDTH] [-l LEFT_IMAGE] [-r RIGHT_IMAGE] [-o OUTPUT_PATH]

optional arguments:
  -h, --help            show this help message and exit
  -e ENGINE_PATH, --engine_path ENGINE_PATH
                        TensorRT engine file path. (default: cgi_stereo_sceneflow_480x640.engine)
  -ih INPUT_HEIGHT, --input_height INPUT_HEIGHT
                        Model input height. (default: 480)
  -iw INPUT_WIDTH, --input_width INPUT_WIDTH
                        Model input width. (default: 640)
  -l LEFT_IMAGE, --left_image LEFT_IMAGE
                        input left image. (default: data/left.png)
  -r RIGHT_IMAGE, --right_image RIGHT_IMAGE
                        input right image. (default: data/right.png)
  -o OUTPUT_PATH, --output_path OUTPUT_PATH
                        output colored disparity image paht. (default: output.png)