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

Will the PhotoShop script for generating the fake images be released? #3

Open
zjxgithub opened this issue Jul 3, 2019 · 6 comments

Comments

@zjxgithub
Copy link

Hi, thanks for sharing the model!
I wonder if you will also release the PhotoShop script for generating the fake images? Thanks!

@jalbertbowden
Copy link

I came to look @ the photoshop script too! Now I'm thinking that the scripts are the python files in the repository, and the title is just clever.

@PeterWang512
Copy link
Owner

Yes, we are planning to release the PhotoShop script to automatically generate FAL-warped faces

@zhangqizky
Copy link

Yes, we are planning to release the PhotoShop script to automatically generate FAL-warped faces

It's awesome!!!

@jalbertbowden
Copy link

Can't wait! Very interested to see what y'all did; I've done some .jsx scripting in the past, but nothing very high level/beyond using action panes/panels.

@jaavant
Copy link

jaavant commented Apr 26, 2020

Been almost a year since the last post, is there any plan to still release the script?

@PeterWang512
Copy link
Owner

PeterWang512 commented May 3, 2020

Sorry for the delay. Below is a script for automating warps for an image, and one can save it as a .jsx file to run it on Photoshop.
To begin with, Photoshop allows users to automate many processes with javascript/applescript/vbscript, and here is the link to guides: https://www.adobe.com/devnet/photoshop/scripting.html.
(Note that the guide above not necessarily covers all operations that can be automated; for example, filters like face-aware liquify.)

As a quick start, you can open up an image with face in photoshop, click on File->Scripts->Browse, and then select the .jsx file to run it.

Hope this helps!

var param_leftEyeSize = Math.random()*2 - 1;
var param_rightEyeSize = Math.random()*2 - 1;
var param_leftEyeHeight = Math.random()*2 - 1;
var param_rightEyeHeight = Math.random()*2 - 1;
var param_leftEyeWidth = Math.random()*2 - 1;
var param_rightEyeWidth = Math.random()*2 - 1;
var param_leftEyeTilt = Math.random()*2 - 1;
var param_rightEyeTilt = Math.random()*2 - 1;
var param_eyeDistance = Math.random()*2 - 1;
var param_smile = Math.random()*2 - 1;
var param_upperLip = Math.random()*2 - 1;
var param_lowerLip = Math.random()*2 - 1;
var param_mouthWidth = Math.random()*2 - 1;
var param_noseWidth = Math.random()*2 - 1;
var param_faceWidth = Math.random()*2 - 1;
var param_chinHeight = Math.random()*2 - 1;
var param_jawShape = Math.random()*2 - 1;
var param_mouthHeight = Math.random()*2 - 1;
var param_noseHeight = Math.random()*2 - 1;
var param_foreheadHeight = Math.random()*2 - 1;

var idLqFy = charIDToTypeID( "LqFy" );
    var desc16 = new ActionDescriptor();
    var idLqMe = charIDToTypeID( "LqMe" );
    var idfaceMesh = stringIDToTypeID( "faceMesh" );
        var desc17 = new ActionDescriptor();
        var idfaceDescriptorVersion = stringIDToTypeID( "faceDescriptorVersion" );
        desc17.putInteger( idfaceDescriptorVersion, 2 );
        var idfaceMeshVersion = stringIDToTypeID( "faceMeshVersion" );
        desc17.putInteger( idfaceMeshVersion, 2 );
        var idfaceInfoList = stringIDToTypeID( "faceInfoList" );
            var list1 = new ActionList();
                var desc18 = new ActionDescriptor();

var idfeatureValues = stringIDToTypeID( "featureValues" );
                    var desc20 = new ActionDescriptor();
                    var idleftEyeSize = stringIDToTypeID( "leftEyeSize" );
                    desc20.putDouble( idleftEyeSize, param_leftEyeSize );
                    var idrightEyeSize = stringIDToTypeID( "rightEyeSize" );
                    desc20.putDouble( idrightEyeSize, param_rightEyeSize );
                    var idleftEyeHeight = stringIDToTypeID( "leftEyeHeight" );
                    desc20.putDouble( idleftEyeHeight, param_leftEyeHeight );
                    var idrightEyeHeight = stringIDToTypeID( "rightEyeHeight" );
                    desc20.putDouble( idrightEyeHeight, param_rightEyeHeight );
                    var idleftEyeWidth = stringIDToTypeID( "leftEyeWidth" );
                    desc20.putDouble( idleftEyeWidth, param_leftEyeWidth );
                    var idrightEyeWidth = stringIDToTypeID( "rightEyeWidth" );
                    desc20.putDouble( idrightEyeWidth, param_rightEyeWidth );
                    var idleftEyeTilt = stringIDToTypeID( "leftEyeTilt" );
                    desc20.putDouble( idleftEyeTilt, param_leftEyeTilt );
                    var idrightEyeTilt = stringIDToTypeID( "rightEyeTilt" );
                    desc20.putDouble( idrightEyeTilt, param_rightEyeTilt );
                    var ideyeDistance = stringIDToTypeID( "eyeDistance" );
                    desc20.putDouble( ideyeDistance, param_eyeDistance );
                    var idsmile = stringIDToTypeID( "smile" );
                    desc20.putDouble( idsmile, param_smile );
                    var idupperLip = stringIDToTypeID( "upperLip" );
                    desc20.putDouble( idupperLip, param_upperLip );
                    var idlowerLip = stringIDToTypeID( "lowerLip" );
                    desc20.putDouble( idlowerLip, param_lowerLip );
                    var idmouthWidth = stringIDToTypeID( "mouthWidth" );
                    desc20.putDouble( idmouthWidth, param_mouthWidth );
                    var idnoseWidth = stringIDToTypeID( "noseWidth" );
                    desc20.putDouble( idnoseWidth, param_noseWidth );
                    var idfaceWidth = stringIDToTypeID( "faceWidth" );
                    desc20.putDouble( idfaceWidth, param_faceWidth );
                    var idchinHeight = stringIDToTypeID( "chinHeight" );
                    desc20.putDouble( idchinHeight, param_chinHeight );
                    var idjawShape = stringIDToTypeID( "jawShape" );
                    desc20.putDouble( idjawShape, param_jawShape );
                    var idmouthHeight = stringIDToTypeID( "mouthHeight" );
                    desc20.putDouble( idmouthHeight, param_mouthHeight );
                    var idnoseHeight = stringIDToTypeID( "noseHeight" );
                    desc20.putDouble( idnoseHeight, param_noseHeight );
                    var idforeheadHeight = stringIDToTypeID( "foreheadHeight" );
                    desc20.putDouble( idforeheadHeight, param_foreheadHeight );
                desc18.putObject( idfeatureValues, idfeatureValues, desc20 );
                var idfeatureDisplacements = stringIDToTypeID( "featureDisplacements" );
                    var desc21 = new ActionDescriptor();
                var idfeatureDisplacements = stringIDToTypeID( "featureDisplacements" );
                desc18.putObject( idfeatureDisplacements, idfeatureDisplacements, desc21 );
            var idfaceInfo = stringIDToTypeID( "faceInfo" );
            list1.putObject( idfaceInfo, desc18 );
        desc17.putList( idfaceInfoList, list1 );
    var idfaceMesh = stringIDToTypeID( "faceMesh" );
    desc16.putObject( idfaceMesh, idfaceMesh, desc17 );
executeAction( idLqFy, desc16, DialogModes.NO );

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

5 participants