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

How to obtain the pretrained pkls for dfvnet and aifnet #6

Open
dusk1037 opened this issue Mar 31, 2024 · 8 comments
Open

How to obtain the pretrained pkls for dfvnet and aifnet #6

dusk1037 opened this issue Mar 31, 2024 · 8 comments

Comments

@dusk1037
Copy link

No description provided.

@singer-yang
Copy link
Owner

Hello dusk1037,

Thanks a lot for your interest! You can run the training code to train your own models. It is very easy and straightforward, and I believe you can get a deeper understanding by doing this.

For this project, the aberration-aware training (AAT) method is more important. You should not expect the model to function for different lenses since the aberrations are different! :-)

Best,
Xinge

@dusk1037
Copy link
Author

dusk1037 commented Apr 1, 2024

Thank you for replying,
does that mean that the ungiven pretrained models labeled as "dfvnet_stack8_480x640.pkl" and "aifnet_stack8_480x640.pkl" can be acquired by following the steps and accessing to the git repos given in the refrenced articles [22]"Deep depth from focus with diffrentisl focus volume" and [20]"Bridging unsupervised and supervised depth from focus via all-in-focus supervision"?

@singer-yang
Copy link
Owner

No. The model weights are highly related to the lens and the pixel size, which affect the 4D PSFs. That also means if you change the lens or the camera sensor, the pretrained model will not work. The pretrained weights in [20] and [22] consider lenses without any aberration, therefore will not work for the RF50mm lens we are using.

I will upload our pretrained weights these days. Or you can run the training code to train the models by yourself. :-)

@dusk1037
Copy link
Author

dusk1037 commented Apr 9, 2024

Huge thanks for replying,
Frankly speaking, I'm currently a college freshman trying to learn more about Computer Vision and Image Processing.
I would like to inquire about what does the "training code" in your former comment refer to?

@singer-yang
Copy link
Owner

Hello dusk1037,

You can run python 2_aber_aware_dff_aif.py which will train a depth-from-focus network model. The model is so-called aberration-aware because it can learn to extract depth information at the existence of aberrations. I assume you have experience in training a deep network, otherwise, you may check this tutorial Dive into deep learning to start.

If you have any questions, please feel free to ask. Hope you enjoy the research of deep learning and computational imaging!!

@dusk1037
Copy link
Author

I happened to encounter a Runtime error:CUDA out of memory when I tried to run the file "2_aber_aware_dff_aif.py", while the original traceback leads me to line 370 in ./dff/Aifnet.py, which consists of a annotation that says "FIXME: bug here", can it be resolved?

@singer-yang
Copy link
Owner

Hello,

This is a bug coming from the original AiFNet architecture. Reducing the stack size should resolve it.

@dusk1037
Copy link
Author

Thank you for your timely replying!

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