microsoft / Bringing-Old-Photos-Back-to-Life

Bringing Old Photo Back to Life (CVPR 2020 oral)
https://arxiv.org/abs/2004.09484
MIT License
14.94k stars 1.97k forks source link

module 'models.networks' has no attribute 'modify_commandline_options' #225

Open bill1969 opened 2 years ago

bill1969 commented 2 years ago

Running Stage 3: Face Enhancement Traceback (most recent call last): File "test_face.py", line 15, in opt = TestOptions().parse() File "E:\picture_fix\Bringing-Old-Photos-Back-to-Life\Face_Enhancement\options\base_options.py", line 262, in parse opt = self.gather_options() File "E:\picture_fix\Bringing-Old-Photos-Back-to-Life\Face_Enhancement\options\base_options.py", line 197, in gather_options parser = model_option_setter(parser, self.isTrain) File "E:\picture_fix\Bringing-Old-Photos-Back-to-Life\Face_Enhancement\models\pix2pix_model.py", line 12, in modify_commandline_options networks.modify_commandline_options(parser, is_train) AttributeError: module 'models.networks' has no attribute 'modify_commandline_options' Finish Stage 3 ...

WillianSalceda commented 2 years ago

had the same problem following Installation guide

FlowDownTheRiver commented 2 years ago

The solution is I give you the folder structure,you need to have "sync_batchnorm" folder inside "Bringing-Old-Photos-Back-to-Life\Face_Enhancement\models\networks" folder so the final structure is going to be like in the picture.Make sure you don't overwrite any file. 2022-04-26 03_00_24-Window

I tell you what guys? After stage 1 it is not worth to do the rest of the stages.Because it is using dlib for faces and even if you compile it with cuda to run faster,it takes time to process the faces.What is worst is that the final results is not worth the time and processing power spent on it.

So I suggest you to edit the run.py file and comment out stage 2,3,4 for efficiency.

These are the original files :

6029756 Damaged-Photo-Restoration-before

These 2 are without face enhancement :

6029756 Damaged-Photo-Restoration-before

These 2 are with face enhancement :

6029756 Damaged-Photo-Restoration-before

For face enhancement you better use gfpgan or gpen.

For convenience edited run.py file: run.zip

I have recorded 2 videos about this project is being used if you wanna watch:

https://www.youtube.com/watch?v=PK3Qpyld9fQ&t

https://www.youtube.com/watch?v=2gS0wzvWZuA&t

All credits goes to related project developers.