codeslake / IFAN

[CVPR 2021] Official PyTorch Implementation for "Iterative Filter Adaptive Network for Single Image Defocus Deblurring"
GNU Affero General Public License v3.0
227 stars 39 forks source link

ZeroDivisionError #10

Closed ikhwan12 closed 2 years ago

ikhwan12 commented 2 years ago

Hi @HyeongseokSon1 ,

I have an issue by running the latest code using this command : python run.py --mode IFAN --network IFAN --config config_IFAN --data DPDD --ckpt_abs_name ckpt/IFAN.pytorch --cpu --data_offset ./test --output_offset ./test_out

Basically I would like to test my 1 .jpg image and store in ./test

The error is shown like this: Capture

Here is my directory list: file

Do you know what is the problem ? or maybe I am doing wrong ?

codeslake commented 2 years ago

Hi, @ikhwan12! I believe the error is due to the misplaced input image. Please try the following steps.

  1. Create a random folder IFAN/test/random.
    • the random folder is described in here (Testing/options/--data).
  2. Place your image inside the random folder (e.g., IFAN/test/random/1.jpg).
  3. Run the following command:
    python run.py --mode IFAN --network IFAN --config config_IFAN --data random --ckpt_abs_name ckpt/IFAN.pytorch --cpu -- 
    data_offset ./test --output_offset ./test_out
ikhwan12 commented 2 years ago

Hi @codeslake Thank you for prompt reply and continuous support.

I have created folder exactly as your instruction and run with your command above.

But I am still having the same error 2

Here is the new folder I created and place my image: 3

codeslake commented 2 years ago

Hi, @ikhwan12.

Thank you for pointing this out! There was a bug for loading images when the inputs are placed within the project folder.

I've just updated the code. Please pull and check whether it is working ok.

ikhwan12 commented 2 years ago

Hi @codeslake Thank you for fixing the code. Now it works.