Facial_Details_Synthesis icon indicating copy to clipboard operation
Facial_Details_Synthesis copied to clipboard

.box file not created

Open GitStarter opened this issue 4 years ago • 7 comments

Hello Anpei,

I am trying to follow the instruction and run the sample file. however, I got the following errors. I recompiled the FaceLandmarkImg.exe and moved everything from that file to replace all the same name files in landmarkDetector folder.

this is the result I got after I try to run the sample code for facialDetails.py. where could I get or make the .box file?

Thank you very much, Linkun

(base) C:\Users\LINK\OneDrive - University of Waterloo\SYDE 671 project\released_v0.1>python facialDetails.py -i ./samples/details/019615.jpg -o ./results Load preTrain model done. Load preTrain model done. Loading the model Reading the landmark detector/tracker from: model/main_ceclm_general.txt Reading the landmark detector module from: model\cen_general.txt Reading the PDM module from: model\pdms/In-the-wild_aligned_PDM_68.txt....Done Reading the Triangulations module from: model\tris_68.txt....Done Reading the intensity CEN patch experts from: model\patch_experts/cen_patches_0.25_of.dat....Done Reading the intensity CEN patch experts from: model\patch_experts/cen_patches_0.35_of.dat....Done Reading the intensity CEN patch experts from: model\patch_experts/cen_patches_0.50_of.dat....Done Reading the intensity CEN patch experts from: model\patch_experts/cen_patches_1.00_of.dat....Done Reading part based module....left_eye_28 Reading the landmark detector/tracker from: model\model_eye/main_clnf_synth_left.txt Reading the landmark detector module from: model\model_eye\clnf_left_synth.txt Reading the PDM module from: model\model_eye\pdms/pdm_28_l_eye_3D_closed.txt....Done Reading the intensity CCNF patch experts from: model\model_eye\patch_experts/left_ccnf_patches_1.00_synth_lid_.txt....Done Reading the intensity CCNF patch experts from: model\model_eye\patch_experts/left_ccnf_patches_1.50_synth_lid_.txt....Done Done Reading part based module....right_eye_28 Reading the landmark detector/tracker from: model\model_eye/main_clnf_synth_right.txt Reading the landmark detector module from: model\model_eye\clnf_right_synth.txt Reading the PDM module from: model\model_eye\pdms/pdm_28_eye_3D_closed.txt....Done Reading the intensity CCNF patch experts from: model\model_eye\patch_experts/ccnf_patches_1.00_synth_lid_.txt....Done Reading the intensity CCNF patch experts from: model\model_eye\patch_experts/ccnf_patches_1.50_synth_lid_.txt....Done Done Reading the landmark validation module....Done Model loaded Reading the AU analysis module from: AU_predictors/main_static_svms.txt Reading the AU predictors from: AU_predictors\AU_all_static.txt... Done Reading the PDM from: AU_predictors\In-the-wild_aligned_PDM_68.txt... Done Reading the triangulation from:AU_predictors\tris_68_full.txt... Done Reading the MTCNN face detector from: model/mtcnn_detector/MTCNN_detector.txt Reading the PNet module from: model/mtcnn_detector\PNet.dat Reading the RNet module from: model/mtcnn_detector\RNet.dat Reading the ONet module from: model/mtcnn_detector\ONet.dat Error: Could not open the image: C:\Users\LINK\OneDrive ===> Landmarks detection done.

===> estimating proxy of C:\Users\LINK\OneDrive - University of Waterloo\SYDE 671 project\released_v0.1\samples\details\019615.jpg Traceback (most recent call last): File "C:\Users\LINK\Anaconda3\lib\shutil.py", line 550, in move os.rename(src, real_dst) FileNotFoundError: [WinError 2] 系统找不到指定的文件。: './landmarkDetector\processed\019615.box' -> 'C:\Users\LINK\OneDrive - University of Waterloo\SYDE 671 project\released_v0.1\results\019615\019615.box'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "facialDetails.py", line 303, in main(args) File "facialDetails.py", line 250, in main move_landmark(args.landmark_exe_path,save_path,base_name[0]) File "facialDetails.py", line 51, in move_landmark shutil.move(os.path.join(landmark_exe_path,'processed',name+'.box'),os.path.join(save_path,name+'.box')) File "C:\Users\LINK\Anaconda3\lib\shutil.py", line 564, in move copy_function(src, real_dst) File "C:\Users\LINK\Anaconda3\lib\shutil.py", line 263, in copy2 copyfile(src, dst, follow_symlinks=follow_symlinks) File "C:\Users\LINK\Anaconda3\lib\shutil.py", line 120, in copyfile with open(src, 'rb') as fsrc: FileNotFoundError: [Errno 2] No such file or directory: './landmarkDetector\processed\019615.box'

(base) C:\Users\LINK\OneDrive - University of Waterloo\SYDE 671 project\released_v0.1>

GitStarter avatar Nov 22 '19 08:11 GitStarter

I think it is because your project path contain some space characters: C:\Users\LINK\OneDrive - University of Waterloo\SYDE 671 project\released_v0.1\

I hope this is helpfully to you.

apchenstu avatar Nov 25 '19 16:11 apchenstu

I have the same problem. Did you have dealt with the problem?

mumuyanyan avatar Jan 03 '20 06:01 mumuyanyan

Even I am facing the same issue and removing the space characters didn't resolve the problem.

janhavisawal avatar May 14 '20 16:05 janhavisawal

I had the same issues even without space characters in project path. Any way to work around it?

JessieW-eyevio avatar May 15 '20 16:05 JessieW-eyevio

I'm not sure this would help. But regarding the problem with space in the file path, I modified the code to make it work. Specifically, I had added a double quote around each path and change the os.system(cmd) to subprocess.run(shlex.split(cmd)) - subprocess, shlex should be imported. As an example, fit_model function in the proxyPredictor.py of my code is looks like,

def fit_model( exepath, imagePath, ptsPath, savePath,landmark_scale,expressionPath):
    current_path = os.getcwd()
    os.chdir(exepath)
    imagePath = '"' + imagePath + '"'
    ptsPath = '"' + ptsPath + '"'
    savePath = '"' + savePath + '"'
    if not expressionPath==None:
        expressionPath = '"' + expressionPath + '"'
    file_path = ' -p ./bfm2017/ibug_to_bfm2017-1_bfm_nomouth.txt -c ./bfm2017/bfm2017-1_bfm_nomouth_model_contours.json'+ \
				' -e ./bfm2017/bfm2017-1_bfm_nomouth_edge_topology.json -m ./bfm2017/bfm2017-1_bfm_nomouth.bin'
    if expressionPath is None:
        cmd = './build/examples/Release/fit-model.exe -i '+ imagePath +' -l '+ptsPath+' -o '+savePath+' --save-texture 0 --save-wireframe 0 --landmark-scale '+ \
		  				str(landmark_scale)+' '+file_path
    else:
        cmd = './build/examples/Release/fit-model.exe -i ' + imagePath +' -l ' +ptsPath +' -o ' +savePath+ \
			   ' --num-fit-iter 10 --init-expression-coeffs-fp '+ expressionPath+ \
				' --fix-expression-coeffs ' + str(args.fit_expression) + ' --save-texture 0 --save-wireframe 0  --landmark-scale '+str(landmark_scale) +' '+ file_path

    subprocess.run(shlex.split(cmd))
    # os.system(cmd)
    os.chdir(current_path)

Hope it helps

SuwoongHeo avatar May 16 '20 05:05 SuwoongHeo

I tried to follow the above steps ^^ which resulted in the following error.

sh: 1: FaceLandmarkImg.exe: not found ===> Landmarks detection done.

===> estimating proxy of /content/000005.jpg sh: 1: fit-model.exe: not found sh: 1: textureRender.exe: not found

janhavisawal avatar May 16 '20 19:05 janhavisawal

The picture's problem?

XIAO-RUI-RUI avatar May 29 '22 12:05 XIAO-RUI-RUI