Skip to content

JundanLuo/CRefNet

Repository files navigation

CRefNet: Learning Consistent Reflectance Estimation With a Decoder-Sharing Transformer

[paper] [supplement doc] [supplement materials]

architecture

Updates

  • 01/Nov/2024: Released the training code.
  • 05/May/2024: Released the trained models and the evaluation code.

Dependencies

  • Python 3.6
  • PyTorch 1.8.2
  • We provide the tools/install.txt file for other dependencies.

Datasets

  • Download:
    • Follow CGIntrinsics to download the CGI, IIW and SAW datasets. Z. Li and N. Snavely augment the original IIW dataset.
    • MIT-intrinsic: Webpage.
    • MPI_Sintel: Webpage. Contact the authors to request the version rendered for intrinsic image decomposition.
  • Split files: we back up the used split files in the dataset/split_files folder. MIT-intrinsic's split is coded in dataset/mit_intrinsic_dataset.py.
  • Put the datasets in the data/ folder. The final directory structure:
    CRefNet project
    |---README.md
    |---...
    |---data
        |---CGIntrinsics
            |---intrinsics_final
                |---images   
                |---rendered
                |---...
            |---IIW
                |---data
                |---test_list
                |---...
            |---SAW
                |---saw_images_512
                |---saw_pixel_labels
                |---saw_splits
                |---train_list
        |---MIT-intrinsic
            |---data
                |---apple
                |---...
        |---MPI_Sintel_IID
            |---MPI-main-albedo
            |---MPI-main-clean
            |---...
    
  • Paths to the datasets are set in configs/config.py.

Train

Navigate to the Training Doc

Trained Models

General Use

Benchmark-Specific Models

Evaluation

Navigate to the Evaluation Doc

Infer

  • Infer on images in a single directory:
      CUDA_VISIBLE_DEVICES="0" python infer.py \
          --img-dir ./test_examples/ \
          --out-dir ./experiments/out_test_examples/ \
          --min_input_dim 448  \
          --output_original_size \
          --cfg="configs/crefnet.yaml" \
          MODEL.checkpoint "./trained_models/final_real.pt"
  • dataset/imagefolder_dataset.py is the dataset class used for loading images in a directory.
  • Other possibly useful options:
    • --gamma_correct_input: convert the input images in linear space into sRGB space.
    • --gamma_correct_output: convert the output images in linear space into sRGB space.
    • --max_input_dim: set the maximum dimension of the input images.
      • If both --min_input_dim and --max_input_dim are set, the aspect ratio may not be preserved.
      • If not set either, the original image size will be used.

Acknowledgements

Citation

If you find this code useful for your research, please cite:

  @article{luo2023crefnet,
    title={CRefNet: Learning Consistent Reflectance Estimation With a Decoder-Sharing Transformer},
    author={Luo, Jundan and Zhao, Nanxuan and Li, Wenbin and Richardt, Christian},
    journal={IEEE Transactions on Visualization and Computer Graphics},
    year={2023},
    publisher={IEEE}
  }

Contact

Please contact Jundan Luo (jundanluo22@gmail.com) if you have any questions. Feel free to give any feedback.

About

Official release of CRefNet.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors