ai-forever / ghost

A new one shot face swap approach for image and video domains
Apache License 2.0
1.25k stars 265 forks source link

Failed to Run: Swap to Many Faces #15

Open Ahmer-444 opened 2 years ago

Ahmer-444 commented 2 years ago

I have tried to swap multi faces, here is the issue I have encountered. Please share thoughts, if anyone is able to replicate the issue or has fixed it.

python3 inference.py --source_paths multispecific/SRC_01.png multispecific/SRC_02.png multispecific/SRC_03.png --target_faces_paths multispecific/DST_01.jpg multispecific/DST_02.jpg multispecific/DST_03.jpg --target_videomultispecific/multi_3s.mp4  --out_video_name out.mp4
Traceback (most recent call last):
  File "inference.py", line 153, in <module>
    main(args)
  File "inference.py", line 104, in main
    BS=args.batch_size)
  File "/content/drive/MyDrive/sber-swap/utils/inference/core.py", line 63, in model_inference
    target_batch_rs = transform_target_to_torch(resized_frs, half=half)
  File "/content/drive/MyDrive/sber-swap/utils/inference/core.py", line 18, in transform_target_to_torch
    target_batch_rs = target_batch_rs[:, :, :, [2,1,0]]/255.
IndexError: too many indices for tensor of dimension 1