Skip to content

Commit 411ddbb

Browse files
committed
adding intial updated model loading and inference code
1 parent 903e8ee commit 411ddbb

File tree

3 files changed

+260
-83
lines changed

3 files changed

+260
-83
lines changed

README.md

+25-16
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
This repository contains the code for the following papers:
44

55
**Colorful Diffuse Intrinsic Image Decomposition in the Wild**, [Chris Careaga](https://ccareaga.github.io/) and [Yağız Aksoy](https://yaksoy.github.io), ACM Transactions on Graphics, 2024 \
6-
(Paper and video coming soon!)
6+
[Paper](https://yaksoy.github.io/papers/TOG24-ColorfulShading.pdf) | [Supplementary](https://yaksoy.github.io/papers/TOG24-ColorfulShading-supp.pdf)
77

88
**Intrinsic Image Decomposition via Ordinal Shading**, [Chris Careaga](https://ccareaga.github.io/) and [Yağız Aksoy](https://yaksoy.github.io), ACM Transactions on Graphics, 2023 \
99
[Paper](https://yaksoy.github.io/papers/TOG23-Intrinsic.pdf) | [Video](https://www.youtube.com/watch?v=pWtJd3hqL3c) | [Supplementary](https://yaksoy.github.io/papers/TOG23-Intrinsic-Supp.pdf) | [Data](https://github.com/compphoto/MIDIntrinsics)
1010

1111
---
1212

1313

14-
We propose a method for generating high-resolution intrinsic image decompositions, for in-the-wild images. Our method consists of multiple stages. We first estimate a grayscale shading layer using our ordinal shading pipeline. We then estimate low-resolution chromaticity information to account for color illumination effects while maintaining global consistency. Using this initial colorful decomposition, we estimate a high-resolution, sparse albedo layer. We show that our decomposition allows us to train a diffuse shading network using only a single rendered indoor dataset.
14+
We propose a method for generating high-resolution intrinsic image decompositions for in-the-wild images. Our method consists of multiple stages. We first estimate a grayscale shading layer using our ordinal shading pipeline. We then estimate low-resolution chromaticity information to account for colorful illumination effects while maintaining global consistency. Using this initial colorful decomposition, we estimate a high-resolution, sparse albedo layer. We show that our decomposition allows us to train a diffuse shading estimation network using only a single rendered indoor dataset.
1515

1616
![representative](./figures/representative.png)
1717

@@ -38,11 +38,10 @@ This will allow you to import the repository as a Python package, and use our pi
3838
## Inference
3939
To run our pipeline on your own images you can use the decompose script:
4040
```python
41-
from chrislib.general import view, tile_imgs, view_scale, uninvert
41+
from chrislib.general import uninvert
4242
from chrislib.data_util import load_image
4343

44-
from intrinsic.pipeline import run_pipeline
45-
from intrinsic.model_util import load_models
44+
from intrinsic.pipeline import load_models, run_pipeline
4645

4746
# load the models from the given paths
4847
models = load_models('final_weights.pt')
@@ -51,12 +50,7 @@ models = load_models('final_weights.pt')
5150
image = load_image('/path/to/input/image')
5251

5352
# run the model on the image using R_0 resizing
54-
results = run_pipeline(
55-
models,
56-
image,
57-
resize_conf=0.0,
58-
maintain_size=True
59-
)
53+
results = run_pipeline(models, image)
6054

6155
albedo = results['albedo']
6256
inv_shd = results['inv_shading']
@@ -65,16 +59,31 @@ inv_shd = results['inv_shading']
6559
shading = uninvert(inv_shd)
6660

6761
```
68-
This will run our pipeline and output the linear albedo and shading. You can run this in your browser as well! [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/compphoto/Intrinsic/blob/main/intrinsic_inference.ipynb)
62+
This will run our pipeline and output the linear intrinsic components. You can run this in your browser as well! [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/compphoto/Intrinsic/blob/main/intrinsic_inference.ipynb)
6963

7064
## Citation
7165

7266
```
67+
@ARTICLE{careagaColorful,
68+
author={Chris Careaga and Ya\u{g}{\i}z Aksoy},
69+
title={Colorful Diffuse Intrinsic Image Decomposition in the Wild},
70+
journal={ACM Trans. Graph.},
71+
year={2024},
72+
volume = {43},
73+
number = {6},
74+
articleno = {178},
75+
numpages = {12},
76+
}
77+
7378
@ARTICLE{careagaIntrinsic,
74-
author={Chris Careaga and Ya\u{g}{\i}z Aksoy},
75-
title={Intrinsic Image Decomposition via Ordinal Shading},
76-
journal={ACM Trans. Graph.},
77-
year={2023},
79+
author={Chris Careaga and Ya\u{g}{\i}z Aksoy},
80+
title={Intrinsic Image Decomposition via Ordinal Shading},
81+
journal={ACM Trans. Graph.},
82+
year={2023},
83+
volume = {43},
84+
number = {1},
85+
articleno = {12},
86+
numpages = {24},
7887
}
7988
```
8089

intrinsic/model_util.py

-48
This file was deleted.

0 commit comments

Comments
 (0)