Skip to main content

MCCNN is a neural network for learning a similarity measure on image patches

Project description

MCCNN

MCCNN neural network for stereo matching cost.

OverviewInstallUsagePretrained Weights for MCCNN networksRelatedReferences

Overview

Pytorch implementation of [MCCNN] neural network which computes a similarity measure on pair of small image patches.

Install from Pypi

MCCNN is available on Pypi and can be installed by:

pip install MCCNN

Developer install

After cloning source code from repository, do a local pip install in a virtualenv through MCCNN Makefile:

make install

PyTorch is an optional dependency. If your work requires it (e.g. training or running neural networks, or loading .pt weight files), install the torch extras group:

make install-torch

or

pip install .[torch]

Note: If you do not need PyTorch, the base make install is sufficient.

Usage

Documentation explains how to train and use MCCNN convolutional neural network. To generate it, please execute the following commands:

make docs

Let's see pandora_plugin_mccnn for real life example.

Pretrained Weights for MCCNN networks

Download weights files

Pretrained weights for mc-cnn fast and mc-cnn accurate neural networks are available in the weights directory :

  • mc_cnn_fast_mb_weights.pt and mc_cnn_accurate_mb_weights.pt are the PyTorch weights of the pretrained networks on the Middlebury dataset [Middlebury]
  • mc_cnn_fast_data_fusion_contest.pt and mc_cnn_accurate_data_fusion_contest.pt are the PyTorch weights of the pretrained networks on the Data Fusion Contest dataset [DFC]
  • mc_cnn_fast_int8_excl_01.onnx and mc_cnn_fast_dw.onnx are the ONNX weights of the pretrained networks on the Middlebury dataset [Middlebury]

To download the pretrained weights:

wget https://raw.githubusercontent.com/CNES/Pandora_MCCNN/master/src/mc_cnn/weights/mc_cnn_fast_mb_weights.pt
wget https://raw.githubusercontent.com/CNES/Pandora_MCCNN/master/src/mc_cnn/weights/mc_cnn_fast_data_fusion_contest.pt
wget https://raw.githubusercontent.com/CNES/Pandora_MCCNN/master/src/mc_cnn/weights/mc_cnn_accurate_mb_weights.pt
wget https://raw.githubusercontent.com/CNES/Pandora_MCCNN/master/src/mc_cnn/weights/mc_cnn_accurate_data_fusion_contest.pt
wget https://raw.githubusercontent.com/CNES/Pandora_MCCNN/master/src/mc_cnn/weights/mc_cnn_fast_int8_excl_01.onnx
wget https://raw.githubusercontent.com/CNES/Pandora_MCCNN/master/src/mc_cnn/weights/mc_cnn_fast_dw.onnx

Access weights from pip package

Pretrained weights are stored into the pip package and downloaded for any installation of mc_cnn pip package. To access it, use the weights submodule :

from mc_cnn.weights import get_weights, get_onnx
mc_cnn_fast_mb_weights_path = get_weights(arch="fast", training_dataset="middlebury")
mc_cnn_fast_data_fusion_contest_path = get_weights(arch="fast", training_dataset="dfc")
mc_cnn_accurate_mb_weights_path = get_weights(arch="accurate", training_dataset="middlebury")
mc_cnn_accurate_data_fusion_contest = get_weights(arch="accurate", training_dataset="dfc")
onnx_mc_cnn_fast_int_8_mb_weights_path = get_onnx(arch="onnx_fast_int8", training_dataset="middlebury")
onnx_mc_cnn_fast_dw_mb_weights_path = get_onnx(arch="onnx_fast_dw", training_dataset="middlebury")

References

Please cite the following paper when using MCCNN:

Defonte, V., Dumas, L., Cournet, M., & Sarrazin, E. (2021, July). Evaluation of MC-CNN Based Stereo Matching Pipeline for the CO3D Earth Observation Program. In 2021 IEEE International Geoscience and Remote Sensing Symposium IGARSS (pp. 7670-7673). IEEE.

Cournet, M., Sarrazin, E., Dumas, L., Michel, J., Guinet, J., Youssefi, D., Defonte, V., Fardet, Q., 2020. Ground-truth generation and disparity estimation for optical satellite imagery. ISPRS - International Archives of the Photogrammetry, Remote Sensing and Spatial Information Sciences.

[MCCNN] Zbontar, J., & LeCun, Y. (2016). Stereo matching by training a convolutional neural network to compare image patches. J. Mach. Learn. Res., 17(1), 2287-2318.

[Middlebury] Scharstein, D., Hirschmüller, H., Kitajima, Y., Krathwohl, G., Nešić, N., Wang, X., & Westling, P. (2014, September). High-resolution stereo datasets with subpixel-accurate ground truth. In German conference on pattern recognition (pp. 31-42). Springer, Cham.

[DFC] Bosch, M., Foster, K., Christie, G., Wang, S., Hager, G. D., & Brown, M. (2019, January). Semantic stereo for incidental satellite images. In 2019 IEEE Winter Conference on Applications of Computer Vision (WACV) (pp. 1524-1532). IEEE.

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

mccnn-1.4.0.tar.gz (30.3 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

mccnn-1.4.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (15.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

mccnn-1.4.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (15.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

mccnn-1.4.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (15.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

mccnn-1.4.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (15.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

File details

Details for the file mccnn-1.4.0.tar.gz.

File metadata

  • Download URL: mccnn-1.4.0.tar.gz
  • Upload date:
  • Size: 30.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mccnn-1.4.0.tar.gz
Algorithm Hash digest
SHA256 5b6a8fec3f432b00df0ee6fc4987036a18931459a7a03e41512f2f7c205591c9
MD5 65b156011b48062aac5ee09f3a876107
BLAKE2b-256 1966219c3f850277b851ce0e5f3048334c7a11205d7329e1813db8f0f0b8172d

See more details on using hashes here.

Provenance

The following attestation bundles were made for mccnn-1.4.0.tar.gz:

Publisher: mccnn_ci.yml on CNES/Pandora_MCCNN

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mccnn-1.4.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for mccnn-1.4.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 168abddcff517b291a262763fd65f6132f282fa9d5dee12aa31261d82cc13fd1
MD5 ef5b735d4661df557fc313f0427aba04
BLAKE2b-256 b45c14362b40f0fa8f1894a78831fc9508207933ad46ef75bc1aac2caad16617

See more details on using hashes here.

Provenance

The following attestation bundles were made for mccnn-1.4.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: mccnn_ci.yml on CNES/Pandora_MCCNN

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mccnn-1.4.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for mccnn-1.4.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9a8bcd611c3589a459280d7ea6e6ed981fa928f5ef263a3de9226354ee79d32c
MD5 b9a814ebc59b2003ba1af8ce1b4ef8de
BLAKE2b-256 def0479877235ec7b44a29fbb0d3ecda9b5f90b3fc76726f4411e931512c2143

See more details on using hashes here.

Provenance

The following attestation bundles were made for mccnn-1.4.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: mccnn_ci.yml on CNES/Pandora_MCCNN

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mccnn-1.4.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for mccnn-1.4.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 932a2140b44cd0384e7c94173d63d56b290baff20654284242dc20c17fcea955
MD5 e7329dfe26347a38c57ec93cb1202b7d
BLAKE2b-256 e3ba2d741d7a9bc66c6b8d8709ac7dbc879045aa2495f4741236e996c573868e

See more details on using hashes here.

Provenance

The following attestation bundles were made for mccnn-1.4.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: mccnn_ci.yml on CNES/Pandora_MCCNN

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mccnn-1.4.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for mccnn-1.4.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 56fd94f1ea54d499e7b60f0ffd8bc3fbfbbfbdcf6d7bf12b622f41bc67163f9c
MD5 f1781a1b84faea0caa302c05793803a9
BLAKE2b-256 ff3b6ad98776efd4ae26f29dd151915fdb7f1d642eeacc4f573e880b7d959ae3

See more details on using hashes here.

Provenance

The following attestation bundles were made for mccnn-1.4.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: mccnn_ci.yml on CNES/Pandora_MCCNN

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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