Closed mjdi closed 1 year ago
You need to add the weights files from your screenshot somewhere and fix the paths:
We use PIPNet to align and crop the face, but missed their weight files.
You may visit PIPNet repo to download the missing weight files or using the files provided by @justindujardin .
These files can also be downloaded from our Baidu Yun Drive with extracting code ygss
.
We'll fix the hardcoded file paths
ASAP!
Just updating the paths to relative paths (after putting the weight files there) works:
evaluation/face_align/PIPNet/lib/tools.py line 60:
weight_file = 'evaluation/face_align/PIPNet/weights/epoch59.pth'
state_dict = torch.load(weight_file, map_location=device)
net.load_state_dict(state_dict)
detector = FaceBoxesDetector(
"FaceBoxes",
"evaluation/face_align/PIPNet/weights/FaceBoxesV2.pth",
use_gpu=True,
device="cuda:0",
)
This entire section of code is also full of hardcoded paths: https://github.com/ygtxr1997/CelebBasis/blob/main/scripts/stable_txt2img.py#L272
Just updating the paths to relative paths (after putting the weight files there) works:
evaluation/face_align/PIPNet/lib/tools.py line 60:
weight_file = 'evaluation/face_align/PIPNet/weights/epoch59.pth' state_dict = torch.load(weight_file, map_location=device) net.load_state_dict(state_dict) detector = FaceBoxesDetector( "FaceBoxes", "evaluation/face_align/PIPNet/weights/FaceBoxesV2.pth", use_gpu=True, device="cuda:0", )
- Code updated, https://github.com/ygtxr1997/CelebBasis/commit/82fdc0eb1b5b93bff5704ba14fda04420eaa19e0.
This entire section of code is also full of hardcoded paths: https://github.com/ygtxr1997/CelebBasis/blob/main/scripts/stable_txt2img.py#L272
- For
stable_txt2img.py#L272
, these hardcoded paths are not used under the default setting. We consider removing these codes or adding the relevant testing options.
I get the following error running
bash 00_align_face.sh <...>/ori <...>/ffhq
due to the hardcoded paths in the get_lmk_model() function in
evaluation/face_align/PIPNet/lib/tools.py
as seen hereAs we can see here, there should be PIPNet weights (and epoch59.pth ?) which need to be downloaded (and instructions for doing so in the README.md)
Please advise, thanks!