apchenstu / Facial_Details_Synthesis

[ICCV2019 Oral] Photo-Realistic Facial Details Synthesis from Single Image
MIT License
625 stars 132 forks source link

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

Open XIAO-RUI-RUI opened 2 years ago

XIAO-RUI-RUI commented 2 years ago

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 commented 1 year ago

I have the same question.

ZHJNCUT commented 1 year ago

Have you solved the problem?