# MonoPCC: Photometric-invariant Cycle Constraint for Monocular Depth Estimation

This repository profile is provided by osrepos.com, an open source repository discovery platform.

Source: osrepos.com
Repository profile: https://osrepos.com/repo/adam99goat-monopcc
Generated for open source discovery and AI-assisted research.

MonoPCC is a PyTorch implementation for monocular depth estimation, specifically designed for endoscopic images using a photometric-invariant cycle constraint. This self-supervised learning approach aims to improve depth prediction accuracy in challenging medical imaging scenarios. It demonstrates state-of-the-art performance on datasets like SCARED and KITTI, and offers a plug-and-play design for integration into various backbone networks.

GitHub: https://github.com/adam99goat/MonoPCC
OSRepos URL: https://osrepos.com/repo/adam99goat-monopcc

## Summary

MonoPCC is a PyTorch implementation for monocular depth estimation, specifically designed for endoscopic images using a photometric-invariant cycle constraint. This self-supervised learning approach aims to improve depth prediction accuracy in challenging medical imaging scenarios. It demonstrates state-of-the-art performance on datasets like SCARED and KITTI, and offers a plug-and-play design for integration into various backbone networks.

## Topics

- 3d-reconstruction
- endoscopy
- monocular-depth-estimation
- self-supervised-learning
- Python
- Medical Imaging
- Computer Vision

## Repository Information

Last analyzed by OSRepos: Fri Feb 27 2026 21:37:06 GMT+0000 (Western European Standard Time)
Detail views: 3
GitHub clicks: 11

## Safety Notice

OSRepos shares public repositories for knowledge and discovery only. Review source code, dependencies, licenses, and security implications before running or installing anything.

## Content

## Introduction
MonoPCC presents a novel PyTorch implementation for monocular depth estimation, primarily focusing on endoscopic images. This project introduces a photometric-invariant cycle constraint, enhancing the accuracy and robustness of depth prediction in complex medical environments. As a self-supervised learning framework, MonoPCC addresses the challenges of acquiring ground truth depth data in endoscopy by leveraging image sequences.

## Installation
To set up MonoPCC, it is recommended to use a `conda` environment with Python 3.7. The necessary dependencies can be installed using `pip` and `pip3` as follows:

shell
pip3 install torch==1.9.0+cu111 torchvision==0.10.0+cu111 torchaudio==0.9.0
pip install dominate==2.4.0 Pillow==6.1.0 visdom==0.1.8
pip install tensorboardX==1.4 opencv-python matplotlib scikit-image
pip3 install mmcv-full==1.3.0 mmsegmentation==0.11.0
pip install timm einops IPython


Data preparation involves datasets such as SCARED, SimCol3D, and SERV-CT. Specific training/test splits for SCARED are defined in `splits/endovis`, with further preprocessing details available in the [AF-SfMLearner repository](https://github.com/ShuweiShao/AF-SfMLearner){target="_blank"}.

## Examples
MonoPCC provides comprehensive evaluation scripts and pre-trained models.

*   **Depth Estimation on SCARED**: To evaluate depth estimation on the SCARED dataset, first prepare ground truth depth maps following the [AF-SfMLearner guide](https://github.com/ShuweiShao/AF-SfMLearner/blob/main/export_gt_depth.py){target="_blank"}. Then, run the evaluation command:
    shell
    CUDA_VISIBLE_DEVICES=0 python evaluate_depth.py --data_path <your_data_path> --load_weights_folder <your_weight_path> \
        --eval_split endovis --dataset endovis --max_depth 150 --png --eval_mono
    
    MonoPCC consistently achieves state-of-the-art results, outperforming several baselines.

*   **Plug and Play Design**: The Photometric-invariant Cycle Constraint (PCC) is designed to be plug-and-play, allowing integration into various backbone networks. For instance, when integrated with [EndoDAC](https://arxiv.org/abs/2405.08672){target="_blank"}, PCC further enhances its performance.

*   **Pose Estimation**: MonoPCC also supports pose estimation. After preparing ground truth pose data as described in [AF-SfMLearner](https://github.com/ShuweiShao/AF-SfMLearner/blob/main/export_gt_pose.py){target="_blank"}, you can evaluate pose estimation using the provided PoseNet models:
    shell
    CUDA_VISIBLE_DEVICES=0 python evaluate_pose.py --data_path <your_data_path> --load_weights_folder <your_weight_path>
    
    Visual trajectories can be generated to demonstrate the accuracy of pose estimation.

*   **3D Reconstruction Demo**: The project showcases a demo of 3D reconstruction using MonoPCC to estimate depth maps from video sequences, which are then used with tools like [ElasticFusion](https://github.com/mp3guy/ElasticFusion){target="_blank"} to generate 3D models.

*   **KITTI Dataset Evaluation**: To demonstrate its effectiveness in general scenarios, MonoPCC has been evaluated on the [KITTI dataset](http://www.cvlibs.net/datasets/kitti/raw_data.php){target="_blank"}. The evaluation command is:
    shell
    CUDA_VISIBLE_DEVICES=0 python evaluate_depth_kitti.py --data_path <kitti_data_path> --load_weights_folder <your_weight_path> \
        --eval_split eigen --dataset kitti --eval_mono
    
    MonoPCC achieves competitive results on KITTI, validating its broad applicability.

## Why Use MonoPCC
MonoPCC stands out for its innovative photometric-invariant cycle constraint, which significantly improves monocular depth estimation, especially in challenging endoscopic imaging. Its self-supervised nature reduces the need for extensive labeled data, making it highly practical. The plug-and-play design allows for easy integration into existing deep learning architectures, enhancing their performance. Furthermore, its demonstrated state-of-the-art results on both medical (SCARED) and general (KITTI) datasets highlight its robustness and versatility for various computer vision tasks.

## Links
*   **GitHub Repository**: [https://github.com/adam99goat/MonoPCC](https://github.com/adam99goat/MonoPCC){target="_blank"}