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

Add ability to skip --target_faces_paths option #20

Closed
netrunner-exe opened this issue Feb 22, 2022 · 1 comment
Closed

Add ability to skip --target_faces_paths option #20

netrunner-exe opened this issue Feb 22, 2022 · 1 comment

Comments

@netrunner-exe
Copy link

Hey! Thank you very much for the work done, we hope that the code will continue to be developed and finalized. There is one question. In the description of the --target_faces_paths option, you noted that you can skip this option and then any face in the photo or video will be selected. Unfortunately, the ability to choose whether to use a face from a screenshot or to automatically select any face does not work. If you skip this parameter, then there will always be an error (for a photo or video)

List of source paths:  ['/content/sber-swap/examples/images/elon_musk.jpg']
List of target paths:  ['examples/images/1.png', 'examples/images/2.png', 'examples/images/3.png']
Traceback (most recent call last):
  File "inference.py", line 153, in <module>
    main(args)
  File "inference.py", line 88, in main
    img = crop_face(img, app, args.crop_size)[0]
  File "/content/sber-swap/utils/inference/image_processing.py", line 16, in crop_face
    image, _ = app.get(image_full, crop_size)
  File "/content/sber-swap/insightface_func/face_detect_crop_multi.py", line 58, in get
    metric='default')
  File "/usr/local/lib/python3.7/dist-packages/insightface/model_zoo/scrfd.py", line 204, in detect
    im_ratio = float(img.shape[0]) / img.shape[1]
AttributeError: 'NoneType' object has no attribute 'shape'

You can skip this parameter only if you remove default=['examples/images/1.png', 'examples/images/2.png', 'examples/images/3.png'], nargs='+'. from it. But then, if necessary, the parameter itself will not work ... Add the ability to choose whether to use automatic face selection or from a screenshot from the video.

Привет! Спасибо большое за проделанную работу, надеемся что код и дальше будет развиваться и дорабатываться. Есть один вопрос. В описании опции --target_faces_paths вы отметили что можно пропустить эту опцию и тогда будет выбираться любое лицо на фото или видео. К сожалению возможность выбирать - использовать лицо со скриншота или чтобы автоматически выбиралось любое лицо (если оно всего одно например) не работает. Если скипнуть этот параметр то всегда (для фото или видео) будет ошибка. Скипнуть этот параметр можно только если убрать из него default=['examples/images/1.png', 'examples/images/2.png', 'examples/images/3.png'], nargs='+'. Но тогда если будет нужно - не будет работать сам параметр...Добавьте возможность выбирать, использовать автоматический выбор лица или со скриншота с видео.

@AlexanderGroshev
Copy link
Collaborator

Hi @netrunner-exe , thanks for the feedback!
We fixed this issue, you can check updated inference.py or change default value to default=[].

Привет, спасибо за ваш отзыв!
Мы исправили эту проблему, можете проверить обновленный inference.py или поменять значение на default=[].

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