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

How to use batch_images in FaceSwapUnit #159

Open
jiyoon0630 opened this issue Dec 6, 2023 · 1 comment
Open

How to use batch_images in FaceSwapUnit #159

jiyoon0630 opened this issue Dec 6, 2023 · 1 comment

Comments

@jiyoon0630
Copy link

Hi.

I was following faceswaplab_api_exambple.py and I'd like to ask how to use batch_images in FaceSwapUnit.

In api_utils.py, batch_images means "list of base64 batch source images" which can be used for blending multiple user images.

However, if I set batch_images as a list of base64 images, then validation error comes like below.

unit1 = FaceSwapUnit(
    source_img=pil_to_base64("user1.png"),  
    batch_images=[pil_to_base64('user1.png'), pil_to_base64('user2.png')]
)

ValidationError: 1 validation error for FaceSwapUnit
batch_images
wrong tuple length 2, expected 1 (type=value_error.tuple.length; actual_length=2; expected_length=1)

I've check that the error comes from Tuple[str]. So I tried to change it to Tuple[str, ... ] or List[str], but it causes same error while requesting.

{'detail': [{'loc': ['body', 'units', 0, 'batch_images'],
'msg': 'wrong tuple length 2, expected 1',
'type': 'value_error.tuple.length',
'ctx': {'actual_length': 2, 'expected_length': 1}}]}

Can you explain how to use batch_images?

@ChenCheng2Cs
Copy link

Did you solve it?

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