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

Why the faceRender.exe is not support displacementMap? #50

Open
XIAO-RUI-RUI opened this issue May 26, 2022 · 2 comments
Open

Why the faceRender.exe is not support displacementMap? #50

XIAO-RUI-RUI opened this issue May 26, 2022 · 2 comments

Comments

@XIAO-RUI-RUI
Copy link

XIAO-RUI-RUI commented May 26, 2022

I find the part of facialDetail.exe,

    #######################  predict details  ##################################
    print('===> predicting details of %s '%img_name)
    save_texture_path = os.path.join(args.output_path, base_name[0], 'result.isomap.png')
    displacementMap, normalMap = predict_details(save_texture_path, args)

    displacementMap = (displacementMap+1)/2*65535
    displacementMap = displacementMap.astype("uint16")
    array_buffer = displacementMap.tobytes()
    img = Image.new("I", displacementMap.T.shape)
    img.frombytes(array_buffer, "raw", "I;16")
    save_path = os.path.join(args.output_path, base_name[0], 'result.displacementmap.png')
    img.save(save_path)

    normalMap = (normalMap+1)/2*255
    save_path = os.path.join(args.output_path, base_name[0], 'result.normalmap.png')
    normalMap = normalMap.astype('uint8')
    Image.fromarray(normalMap).save(save_path)

    if args.visualize:
        args.face_render_path = os.path.abspath(args.face_render_path)
        cmd = '%s/hmrenderer.exe %s %s %s'%(args.face_render_path,save_obj_path+'.obj',save_path,args.face_render_path+'/shaders')
        os.system(cmd)
    print('\n')

I also find the src of faceRender.exe is also not use displacementMap, code following

void parseArgs(int argc, char** argv) {
kShaderDir_ = "../src/shaders";
kObjPath = std::string(argv[1]);
kNrmPath = std::string(argv[2]);
if(argc>3)
kShaderDir_ = argv[3];
}

So the cmd just links to normalmap, not to displacementMap. So it not correspond to paper's section 4 Deep Facial Detail Synthesis, use estimated displacementMap to correct proxy.
So there have some way to use displacementMap in faceRender.exe, or new version of faceRender.exe?

@happyday521
Copy link

I have the same question.

@ZHJNCUT
Copy link

ZHJNCUT commented Jun 10, 2023

Have you solved the problem?

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

3 participants