Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error in demo.py #2

Open
crankyz opened this issue Aug 16, 2024 · 9 comments
Open

error in demo.py #2

crankyz opened this issue Aug 16, 2024 · 9 comments

Comments

@crankyz
Copy link

crankyz commented Aug 16, 2024

when launching got this:
ERROR: No matching distribution found for net.model

@toummHus
Copy link
Owner

Thanks for the reminder, now I have corrected this bug. Feel free to comment if you still find any problem.

@crankyz
Copy link
Author

crankyz commented Aug 21, 2024

Thank you for an answer, but now another error
python demo.py --test_path './test/demo/image.png' --output_path './output/demo/'
Traceback (most recent call last):
File "demo.py", line 109, in
net = HAIRModel().load_from_checkpoint(ckpt_path).to(device)
File "/home/igorv/anaconda3/envs/hair/lib/python3.8/site-packages/lightning/pytorch/utilities/model_helpers.py", line 121, in wrapper
raise TypeError(
TypeError: The classmethod HAIRModel.load_from_checkpoint cannot be called on an instance. Please call it on the class type and make sure the return value is used.

@toummHus
Copy link
Owner

Thank you for an answer, but now another error python demo.py --test_path './test/demo/image.png' --output_path './output/demo/' Traceback (most recent call last): File "demo.py", line 109, in net = HAIRModel().load_from_checkpoint(ckpt_path).to(device) File "/home/igorv/anaconda3/envs/hair/lib/python3.8/site-packages/lightning/pytorch/utilities/model_helpers.py", line 121, in wrapper raise TypeError( TypeError: The classmethod HAIRModel.load_from_checkpoint cannot be called on an instance. Please call it on the class type and make sure the return value is used.

Thanks again for the important feedback. It should work now.

@crankyz
Copy link
Author

crankyz commented Aug 22, 2024

line 109 in demo.py must be "net". script launched but I've got only same image in output directory, nothing changed same as use "Tiling" or not. very_simple_demo.py work ok. so very dunno what to do, no errors but no results )
image3
image3

@toummHus
Copy link
Owner

line 109 in demo.py must be "net". script launched but I've got only same image in output directory, nothing changed same as use "Tiling" or not. very_simple_demo.py work ok. so very dunno what to do, no errors but no results ) image3 image3

Apologize for my carelessness, since I didn't try to run the code myself yesterday. After I corrected the typo in line 109, I tried to run the code, and it worked well, as shown below:
image
image
Please ensure that you download the pre-trained model (i.e. hair3d.ckpt), and put it in HAIR/ckpt/hair3d.ckpt to make sure your net is loaded correctly.

@toummHus
Copy link
Owner

line 109 in demo.py must be "net". script launched but I've got only same image in output directory, nothing changed same as use "Tiling" or not. very_simple_demo.py work ok. so very dunno what to do, no errors but no results ) image3 image3

Still, it's very, very strange to get the same image as the output, since the net will never be a identity mapping. Please check your setting again: did you enter the correct path?
It's suggested to directly download the new version of our code and try again. Contact me if you still find any bug

@crankyz
Copy link
Author

crankyz commented Aug 22, 2024

thank you for a fast answer. as I tried derain on your picture worked well, but denoising on a picture with "wolf" actually not (
5 and on a picture like this same (
but on this worked fine with deraining
6

@toummHus
Copy link
Owner

thank you for a fast answer. as I tried derain on your picture worked well, but denoising on a picture with "wolf" actually not ( 5 and on a picture like this same ( but on this worked fine with deraining 6

For the derain, the results are normal since the model are only trained with the second type of raindrops.
For the denoise task, I know where is wrong: it seems like you directly use the image I present in my paper as the degraded image, then there is no wonder it fail to work. The image I presented are specially processed to look clearer, so it is no longer a simple "Gaussian noisy image". Please use this noisy image and try again.
noisy_25_17

@toummHus
Copy link
Owner

For gaussian denoising, please ensure your input is only with a gaussian noise with a std of {15,25,50} in the value range of [0,255]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants