Info in json files.

Converting source frames into swapped frames
Forum rules
Read the FAQs and search the forum before posting a new topic.

Please mark any answers that fixed your problems so others can find the solutions.
Locked
User avatar
akatray
Posts: 4
Joined: Thu Oct 10, 2019 9:04 pm
Has thanked: 1 time

Info in json files.

Post by akatray » Thu Oct 10, 2019 9:18 pm

Can you place back face back to frame with data in json file.
It seems it only contains where face is in frame and not rotation or scale of cut face.

Or do I need to recut face from frame, scale rotate using landmarks, fit model onto it and place back as now I have rotation and scale.
by torzdf » Thu Oct 10, 2019 9:54 pm
The code which does the rotation/warping is referenced from lib.faces_detect https://faceswap.readthedocs.io/en/late ... etect.html
Go to full post

User avatar
akatray
Posts: 4
Joined: Thu Oct 10, 2019 9:04 pm
Has thanked: 1 time

Info in json files.

Post by akatray » Thu Oct 10, 2019 9:21 pm

Does json file have information how to place cut face back to frame. Or just info about face in frame.

User avatar
torzdf
Posts: 176
Joined: Fri Jul 12, 2019 12:53 am
Answers: 46
Has thanked: 8 times
Been thanked: 29 times

Re: Info in json files.

Post by torzdf » Thu Oct 10, 2019 9:32 pm

Json file contains where the face and landmarks are in the original frame. The cropping of the face from the frame is calculated from this information
My word is final

User avatar
akatray
Posts: 4
Joined: Thu Oct 10, 2019 9:04 pm
Has thanked: 1 time

Re: Info in json files.

Post by akatray » Thu Oct 10, 2019 9:50 pm

Image
Is there is some reference values for these points to compare against?
Could get rotation by rotating 2 and 14 until they are in same y coordinates.
Not really have idea how to get scale. As relations will be different between faces.

And I know its stupid questions, but I only use faceswap just to extract faces to use in my program that does transformation.
Would like it to be able to add them back.

User avatar
torzdf
Posts: 176
Joined: Fri Jul 12, 2019 12:53 am
Answers: 46
Has thanked: 8 times
Been thanked: 29 times

Re: Info in json files.

Post by torzdf » Thu Oct 10, 2019 9:54 pm

The code which does the rotation/warping is referenced from lib.faces_detect https://faceswap.readthedocs.io/en/late ... etect.html
My word is final

User avatar
akatray
Posts: 4
Joined: Thu Oct 10, 2019 9:04 pm
Has thanked: 1 time

Re: Info in json files.

Post by akatray » Thu Oct 10, 2019 10:20 pm

Well thanks for help. It seems I found function that transform landmarks to cut face. Will try to find point where it save to json so I can have originals and transformed. That should be all I need.

Locked