Skip to main content

Compare various stereo depth estimation algorithms on image files or with an OAK-D camera.

Project description

Unit Tests Twitter Badge

stereodemo

Small Python utility to compare and visualize the output of various stereo depth estimation algorithms:

  • Make it easy to get a qualitative evaluation of several state-of-the-art models in the wild
  • Feed it left/right images or capture live from an OAK-D camera
  • Interactive colored point-cloud view since nice-looking disparity images can be misleading
  • Try different parameters on the same image

Included methods (implementation/pre-trained models taken from their respective authors):

  • OpenCV stereo block matching and Semi-global block matching baselines, with all their parameters
  • CREStereo: "Practical Stereo Matching via Cascaded Recurrent Network with Adaptive Correlation" (CVPR 2022)
  • RAFT-Stereo: "Multilevel Recurrent Field Transforms for Stereo Matching" (3DV 2021)
  • Hitnet: "Hierarchical Iterative Tile Refinement Network for Real-time Stereo Matching" (CVPR 2021)
  • Chang et al. RealtimeStereo: "Attention-Aware Feature Aggregation for Real-time Stereo Matching on Edge Devices" (ACCV 2020)

See below for more details / credits to get each of these working.

https://user-images.githubusercontent.com/541507/169557430-48e62510-60c2-4a2b-8747-f9606e405f74.mp4

Getting started

Installation

python3 -m pip install stereodemo

Running it

With an OAK-D camera

To capture data directly from an OAK-D camera, use:

stereodemo --oak

Then click on Next Image to capture a new one.

With image files

For convenience a tiny subset of some popular datasets is included in this repository. Just provide a folder to stereodemo and it'll look for left/right pairs (either im0/im1 or left/right in the names):

# To evaluate on the oak-d images
stereodemo datasets/oak-d 

# To cycle through all images
stereodemo datasets

Then click on Next Image to cycle through the images.

Sample images included in this repository:

Dependencies

pip will install the dependencies automatically. Here is the list:

  • Open3D. For the point cloud visualization and the GUI.
  • OpenCV. For image loading and the traditional block matching baselines.
  • onnxruntime. To run pretrained models in the ONNX format.
  • pytorch. To run pretrained models exported as torch script.
  • depthai. Optional, to grab images from a Luxonis OAK camera.

Credits for each method

I did not implement any of these myself, but just collected pre-trained models or converted them to torch script / ONNX.

License

The code of stereodemo is MIT licensed, but the pre-trained models are subject to the license of their respective implementation.

The sample images have the license of their respective source, except for datasets/oak-d which is licenced under Creative Commons Attribution 4.0 International License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stereodemo-0.1.tar.gz (30.4 MB view details)

Uploaded Source

Built Distribution

stereodemo-0.1-py3-none-any.whl (26.6 kB view details)

Uploaded Python 3

File details

Details for the file stereodemo-0.1.tar.gz.

File metadata

  • Download URL: stereodemo-0.1.tar.gz
  • Upload date:
  • Size: 30.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.13

File hashes

Hashes for stereodemo-0.1.tar.gz
Algorithm Hash digest
SHA256 5302396a5d8757b8045451b5ac8a3695e754f5aa8c8765a17dc9dc2a05e218ea
MD5 12c888aa4a0c00ae48096bbb5f2367dc
BLAKE2b-256 30b0d3bc5d756cdbe967d783515d3e597c50a4196e51163437c3ab525234a851

See more details on using hashes here.

File details

Details for the file stereodemo-0.1-py3-none-any.whl.

File metadata

  • Download URL: stereodemo-0.1-py3-none-any.whl
  • Upload date:
  • Size: 26.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.13

File hashes

Hashes for stereodemo-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f8bb2fa77d4ebd65c592d1173ff59c74aecdc2d4235955fb073280969f1f85f2
MD5 1a8fc7134f5b2ef30742acc5fad3f248
BLAKE2b-256 14ab6ae5e6f431db116123a24e44989960717b9e125cd0a4537b40cdd8832afc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page