fnzhan / EMLight

[AAAI 2021] EMLight: Lighting Estimation via Spherical Distribution Approximation, [TIP] GMLight: Lighting Estimation via Geometric Distribution Approximation
172 stars 35 forks source link

dataset for training #2

Closed weberhen closed 3 years ago

weberhen commented 3 years ago

Hi,

congrats for the great work!

I'm trying to run the training code and I'm getting the following error:

(base) root@bd14969643f5:~/codes/Illumination-Estimation/RegressionNetwork# CUDA_VISIBLE_DEVICES=2 python train.py
  + Number of params: 9.50M
0 optim: 0.001
Traceback (most recent call last):
  File "train.py", line 68, in <module>
    for i, para in enumerate(dataloader):
  File "/opt/conda/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__
    data = self._next_data()
  File "/opt/conda/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data
    data = self._dataset_fetcher.fetch(index)  # may raise StopIteration
  File "/opt/conda/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/opt/conda/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/root/codes/Illumination-Estimation/RegressionNetwork/data.py", line 68, in __getitem__
    training_pair['depth'] = torch.from_numpy(gt['depth']).float()
KeyError: 'depth'

I generated the dataset using distribution_representation.py, but I could not find anywhere the depth being added to the list.

Thanks for the help!

fnzhan commented 3 years ago

I obtain the depth value by sending email to the author of 'deep parametric indoor lighting estimation'. Then the depth map can be processed similarly to obtain the ground truth for regression.

And you can also delete the depth part directly, and run the model, which is equivalent to EMLight.

weberhen commented 3 years ago

I see, thanks!

And from the depth map, you actually only need the depth on the (128) anchor points right?

fnzhan commented 3 years ago

I see, thanks!

And from the depth map, you actually only need the depth on the (128) anchor points right?

In fact, we average the depth of pixels assigned to an anchor points, but it's not a big difference.