sjmoran / CURL

Code for the ICPR 2020 paper: "CURL: Neural Curve Layers for Image Enhancement"
205 stars 34 forks source link

inference of test images #29

Closed devriesewouter89 closed 2 years ago

devriesewouter89 commented 2 years ago

Hi I'm testing out your code and have two issues, a technical one and one of understanding:

  1. I'm running the code as described in readme.md, I've adapted the adobe5k_dpe/images_inference.txt to have a2803 as this image is in all folders. Yet now when executing I get an error: 2022-05-10 08:31:03,062 INFO Performing inference with images in directory: ./adobe5k_dpe/ Traceback (most recent call last): File "main.py", line 351, in <module> main() File "main.py", line 127, in main inference_evaluator.evaluate(net, epoch=0) File "/content/CURL/metric.py", line 79, in evaluate net_output_img_example ,_= net(img) File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 727, in _call_impl result = self.forward(*input, **kwargs) File "/content/CURL/model.py", line 543, in forward feat = self.tednet(img) File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 727, in _call_impl result = self.forward(*input, **kwargs) File "/content/CURL/rgb_ted.py", line 299, in forward output_img= self.ted(img.float()) File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 727, in _call_impl result = self.forward(*input, **kwargs) File "/content/CURL/rgb_ted.py", line 99, in forward conv1 = self.dconv_down1(x) File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 727, in _call_impl result = self.forward(*input, **kwargs) File "/content/CURL/rgb_ted.py", line 189, in forward x = self.lrelu(self.conv1(self.refpad(x_in))) File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 727, in _call_impl result = self.forward(*input, **kwargs) File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/conv.py", line 423, in forward return self._conv_forward(input, self.weight) File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/conv.py", line 420, in _conv_forward self.padding, self.dilation, self.groups) RuntimeError: Given groups=1, weight of size [16, 3, 3, 3], expected input[1, 4, 342, 514] to have 3 channels, but got 4 channels instead

I'm assuming this has got to do with an alpha channel being present, yet wonder if I'm correct as there are images you've used as well?

  1. Do you always need a groundtruth image PER input file? Or would it be possible to have a set of groundtruth-input files and some more input files, in order to have the same image enhancements on all input files?
sjmoran commented 2 years ago

Thank you for your interest in CURL:

  1. Please see related issue here
  2. A groundtruth file is not specifically required for inference unless you want to compute quality metrics. You can edit the code to skip evaluation and perform inference on images that do not have an associated groundtruth image.