ICTMCG / CSCS

[ACM TOG, 2024] Identity-Preserving Face Swapping via Dual Surrogate Generative Models
https://bone-11.github.io/cs-cs
24 stars 4 forks source link

PermissionError: [Errno 13] Permission denied: 'C:\\tut\\CSCS\\assets\\aligned\\src' #2

Closed nitinmukesh closed 2 months ago

nitinmukesh commented 2 months ago

I installed on Windows 11.

Alignment completed

(venv) C:\tut\CSCS>python align/align_faces_parallel.py --input assets/unaligned --output assets/aligned --num_threads
1
src.jpeg
trgt.jpg
1
Running on 2 paths
Here we goooo
[('assets/unaligned\\src.jpeg', 'assets/aligned\\src.jpeg'), ('assets/unaligned\\trgt.jpg', 'assets/aligned\\trgt.jpg')]
        SpawnPoolWorker-1 is starting to extract on #2 images
        Done!
Mischief managed in 2.7975008487701416s

Inference getting error

(venv) C:\tut\CSCS>python inference_adapter.py --adapter_type add --src_path assets/aligned/src --tgt_path assets/aligned/trgt --output_dir output --weight_path model_34_loss_-0.1688.pth.tar --ID_emb_model_path model/arcface/ms1mv3_arcfac
e_r100_fp16_backbone.pth
C:\tut\CSCS\inference_adapter.py:78: FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
  model_weight = torch.load(opt.weight_path, map_location='cpu')
C:\tut\CSCS\inference_adapter.py:82: FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
  ID_emb.load_state_dict(torch.load(opt.ID_emb_model_path, map_location='cpu'))
src image load error
assets/aligned/src
[Errno 13] Permission denied: 'C:\\tut\\CSCS\\assets\\aligned\\src'
Traceback (most recent call last):
  File "C:\tut\CSCS\inference_adapter.py", line 112, in <module>
    raise e
  File "C:\tut\CSCS\inference_adapter.py", line 107, in <module>
    img_a = load_sample(src)
  File "C:\tut\CSCS\inference_adapter.py", line 54, in load_sample
    img = Image.open(img_path).convert('RGB')
  File "C:\tut\CSCS\venv\lib\site-packages\PIL\Image.py", line 3431, in open
    fp = builtins.open(filename, "rb")
PermissionError: [Errno 13] Permission denied: 'C:\\tut\\CSCS\\assets\\aligned\\src'

Src and target folder

image

image