Page 1 of 1

Info in json files.

Posted: Thu Oct 10, 2019 9:18 pm
by akatray

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.


Info in json files.

Posted: Thu Oct 10, 2019 9:21 pm
by akatray

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


Re: Info in json files.

Posted: Thu Oct 10, 2019 9:32 pm
by torzdf

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


Re: Info in json files.

Posted: Thu Oct 10, 2019 9:50 pm
by akatray

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.


Re: Info in json files.

Posted: Thu Oct 10, 2019 9:54 pm
by torzdf

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


Re: Info in json files.

Posted: Thu Oct 10, 2019 10:20 pm
by akatray

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.