jwyang / face-alignment

Face alignment in 3000 FPS
322 stars 190 forks source link

A problem about "Ts_bbox.mat" #1

Open weiyt2014 opened 10 years ago

weiyt2014 commented 10 years ago

load('Ts_bbox.mat').Is the file of "Ts_bbox.mat" lost? Or how to create "Ts_bbox.mat"?

jwyang commented 10 years ago

Hi, Ts_bbox is a learned transformation matrix from the bounding boxs obtained via face detector to those of groundtruth face shapes, which is originally aimed to adapt a OpenCV/Matlab face detector to the face alignment algorithm. Actually, you can obtain the transformation by yourself with Data{i}.bbox_gt and Data{i}.bbox_facedet. Alternatively, you can comment it to run the original algorithm in the paper.

在 2014-10-11 08:59:26,"weiyt2014" notifications@github.com 写道:

load('Ts_bbox.mat').Is the file of "Ts_bbox.mat" lost? Or how to create "Ts_bbox.mat"?

— Reply to this email directly or view it on GitHub.

weiyt2014 commented 10 years ago

Thanks very much! I have also a problem about "function LBFRegModel = train_model(dbnames, method, LBFRegModel_initial)", The function has three parameters.I don't know "method" is udsed to do what?Because mistake is about "method"?

jwyang commented 10 years ago

@weiyt2014, never mind, I have deleted the variable from train_model.m.

weiyt2014 commented 10 years ago

Thanks very much!

train_model Already initialized train random forests for landmarks... extract local binary features... Error in derivebinaryfeat (line 15) dims_binfeat = 0;

Output argument "binfeatures" (and maybe others) not assigned during call to "D:\Program Files\MATLAB\R2012a\bin\face-alignment-master\src\derivebinaryfeat.m>derivebinaryfeat".

Error in train_model (line 195) binfeatures = derivebinaryfeat(randf{s}, Data, Param, s);

How to solve thisproblem? Because this function "derivebinaryfeat.m" is key to obtain local binary features?

jwyang commented 10 years ago

@weiyt2014, have you get the random forest model from train_randomfs(Data, Param, s) ?

jwyang commented 10 years ago

hi, @weiyt2014 , I have made some clarifications to the file train_model.m, please pull request again.

weiyt2014 commented 10 years ago

Thanks very much!

weiyt2014 commented 10 years ago

I'm sorry to interrupt you!

51th landmark is over 64th landmark is processing... 61th landmark is over 60th landmark is processing... 56th landmark is over 66th landmark is processing... 64th landmark is over 63th landmark is processing... 60th landmark is over 68th landmark is processing... 68th landmark is over 67th landmark is processing... 66th landmark is over 65th landmark is processing... 65th landmark is over 63th landmark is over 67th landmark is over Elapsed time is 0.364708 seconds. extract local binary features...

Error in derivebinaryfeat (line 15) dims_binfeat = 0;

Output argument "binfeatures" (and maybe others) not assigned during call to "D:\Program Files\MATLAB\R2012a\bin\face-alignment-master\src\derivebinaryfeat.m>derivebinaryfeat".

Error in train_model (line 201) binfeatures = derivebinaryfeat(randf{s}, Data, Param, s);

I see your request about the code change part and amend the code!But The problem is still unsloved!

jwyang commented 10 years ago

hi, @weiyt2014 , have you debug and found the problems?

weiyt2014 commented 10 years ago

yes.The problems is always ocucured.And I try long but I haven't found solutions. I need some instruction.Thanks very much.

weiyt2014 commented 10 years ago

yes.The problems is always ocucured.And I try long but I haven't found solutions. I need some instruction.Thanks very much.

weiyt2014 commented 10 years ago

yes.The problems is always ocucured.And I try long but I haven't found solutions. I need some instruction.Thanks very much.

jwyang commented 10 years ago

@weiyt2014, could you tell me which line collapsed when you debug?

weiyt2014 commented 10 years ago

Error in derivebinaryfeat (line 15) dims_binfeat = 0;

Error in train_model (line 201) binfeatures = derivebinaryfeat(randf{s}, Data, Param, s);

jwyang commented 10 years ago

can you step by step and figure out why this error happened? I cannot recognize the problem directly from your message.

在 2014-10-13 08:10:29,"weiyt2014" notifications@github.com 写道:

Error in derivebinaryfeat (line 15) dims_binfeat = 0;

Error in train_model (line 201) binfeatures = derivebinaryfeat(randf{s}, Data, Param, s);

— Reply to this email directly or view it on GitHub.

weiyt2014 commented 10 years ago

The step of "train random forests for landmarks"is success, The step of "extract local binary features" is failed,because "Output argument "binfeatures" (and maybe others) not assigned during call to "D:\Program Files\MATLAB\R2012a\bin\face-alignment-master\src\derivebinaryfeat.m>derivebinaryfeat"."

I don't know whether to explain clearly?

jwyang commented 10 years ago

do you run the codes in matlab? I suggest you set up some breakpoints in the file derivebinaryfeat.m , and press F5 to see which causes such issue.

At 2014-10-13 10:39:22, "weiyt2014" notifications@github.com wrote:

The step of "train random forests for landmarks"is success, The step of "extract local binary features" is failed,because "Output argument "binfeatures" (and maybe others) not assigned during call to "D:\Program Files\MATLAB\R2012a\bin\face-alignment-master\src\derivebinaryfeat.m>derivebinaryfeat"."

I don't know whether to explain clearly?

— Reply to this email directly or view it on GitHub.

weiyt2014 commented 10 years ago

The problem is found.The code of dereivebinaryfeat.mat is not executed from "Line 104~Line 150",namely, The code between "parfor i = 1:dbsize*(params.augnumber)"and "end" is skipped.So binfeatures is not assigned. The code is how to modify? I hope to get suggestions!Thanks very much!

jwyang commented 10 years ago

is the variable dbsize or params.augnumber is equal to zero ?

At 2014-10-13 11:21:43, "weiyt2014" notifications@github.com wrote:

The problem is found.The code of dereivebinaryfeat.mat is not executed from "Line 104~Line 150",namely, The code between "parfor i = 1:dbsize*(params.augnumber)"and "end" is skipped.So binfeatures is not assigned. The code is how to modify? I hope to get suggestions!Thanks very much!

— Reply to this email directly or view it on GitHub.

weiyt2014 commented 10 years ago

imgpathlistfile = strcat('G:\Code\2014-10-8\face-alignment-master\Database\trainset', dbnames(i), '\Path_Images.txt');

how to get “Path_Images.txt”?Database find the file!

jwyang commented 10 years ago

Have you downloaded some datasets from the link I provided? If yes, then you can get the file very simply. In the root folder of a image dataset, e.g. lfpw dataset, first create a bat file, and paste "dir /b/s/p/w *.jpg>Path_Images.txt" into the file. Then, run this bat file. You will get the file "Path_Images.txt" as expected.

good luck!

在 2014-10-13 16:19:52,"weiyt2014" notifications@github.com 写道:

imgpathlistfile = strcat('G:\Code\2014-10-8\face-alignment-master\Database\trainset', dbnames(i), '\Path_Images.txt');

how to get “Path_Images.txt”?Database find the file!

— Reply to this email directly or view it on GitHub.

weiyt2014 commented 10 years ago

I'm sorry to interupt you again! I have also two problems. First, loadsamples.m "function [Data, bboxes] = loadsamples(imgpathlistfile, exc_setlabel)" need to return [[Data, bboxes],but the value of [bboxes and Data] is empty,so that train_model.m the line 40~41 " [tr_data, ~] = loadsamples(imgpathlistfile, 2); Tr_Data = [Tr_Data; tr_data];"tr_data is empty and Tr_Data is also empty.So derivebinaryfeat.m has always mistakes. And I hope to coorect the mistake "Error in derivebinaryfeat (line 15) dims_binfeat = 0;

Output argument "binfeatures" (and maybe others) not assigned during call to "D:\Program Files\MATLAB\R2012a\bin\face-alignment-master\src\src\derivebinaryfeat.m>derivebinaryfeat"."

Second, loadsamples.m the line 129~132 "bboxes = [bboxes_gt bboxes_facedet]; bboxes = bboxes(ind_valid == 1, :);

Data = Data(ind_valid == 1);" bboxes and Data is always empty.But before the lines ,all lines is executed success. I hope to learn "bboxes" is what to do. And how to modify code to correct mistakes.

Thanks very much!

jwyang commented 10 years ago

It's okay, I am glad to help you out. I have deleted the rebundant codes in loadsamples.m, please pull it again.

Towards your first problem, did you provide the right imgpathlistfile? Then, the variable exc_setlabel should be 1 or 2. To debug, you can change the 'parfor' at line 16 to 'for' so that you can step in the loop.

As for the second problem, bboxes_gt is the groundtruth boxes of groundtruth shape; bboxes_facedet is the bboxes detected by matlab face detector. I need them to learn a regressor from bboxes of face detector to the groundtruth boxes so that the algorithm is applicable to OpenCV or matlab face detector. In your case, you most urgent issue is to run the codes successfully, so have deleted some relevant codes in the newest version loadsamples.m

good luck!

At 2014-10-14 17:16:55, "weiyt2014" notifications@github.com wrote:

I'm sorry to interupt you again! I have also two problems. First, loadsamples.m "function [Data, bboxes] = loadsamples(imgpathlistfile, exc_setlabel)" need to return [[Data, bboxes],but the value of [bboxes and Data] is empty,so that train_model.m the line 40~41 " [tr_data, ~] = loadsamples(imgpathlistfile, 2); Tr_Data = [Tr_Data; tr_data];"tr_data is empty and Tr_Data is also empty.So derivebinaryfeat.m has always mistakes. And I hope to coorect the mistake "Error in derivebinaryfeat (line 15) dims_binfeat = 0;

Output argument "binfeatures" (and maybe others) not assigned during call to "D:\Program Files\MATLAB\R2012a\bin\face-alignment-master\src\src\derivebinaryfeat.m>derivebinaryfeat"."

Second, loadsamples.m the line 129~132 "bboxes = [bboxes_gt bboxes_facedet]; bboxes = bboxes(ind_valid == 1, :);

Data = Data(ind_valid == 1);" bboxes and Data is always empty.But before the lines ,all lines is executed success. I hope to learn "bboxes" is what to do. And how to modify code to correct mistakes.

Thanks very much!

— Reply to this email directly or view it on GitHub.

weiyt2014 commented 10 years ago

It's also a problem. "Undefined function 'randsparse' for input arguments of type 'double'.

Error in globalregression (line 78) w0=randsparse(n,k);

Error in train_model (line 212) [W, Data] = globalregression(binfeatures, Data, Param, s);"

function randsparse() is undefined.And The function is what to do ? How to obtain the function?

jwyang commented 10 years ago

Hi, these codes are used for learning W using dals toolbox, please use liblinear alternatively. You can just comment them to rule out the errors.

在 2014-10-15 16:06:07,"weiyt2014" notifications@github.com 写道:

It's also a problem. "Undefined function 'randsparse' for input arguments of type 'double'.

Error in globalregression (line 78) w0=randsparse(n,k);

Error in train_model (line 212) [W, Data] = globalregression(binfeatures, Data, Param, s);"

function randsparse() is undefined.And The function is what to do ? How to obtain the function?

— Reply to this email directly or view it on GitHub.

weiyt2014 commented 10 years ago

I'm sorry to interupt you again! I have also two problems. First, the detaset 'lfpw'has trainset and testset ,whether the "Path_Images.txt" include the trainset and testset? Or "Path_Images1.txt" is trainset and "Path_Images2.txt" is testset?

Second, in loadsamples.m I add some lines "fid=fopen(imgpathlistfile); imgpathlist = textscan(fid, '%s', 'delimiter', '\n'); fclose(fid);"

The path of "imgpathlistfile" is right, but the value of "fid" is -1, the opening file is failed? I hope to learn some solutions? And first ,I train these data and the fid is successful ,but I test these data and the fid is failed.The pathes are both right ,I hope to know why?

Thanks very much!

jwyang commented 10 years ago

@weiyt2014 , hi, the Path_Images.txt should include both trainset and testset, you can use the the input exc_setlabel in loadsamples to exclude trainset or testset.

as for the second issue, I am sorry that i cannot tell what happened if the path was absolutely right. You may replace "imgpathlistfile" by an absolute path, e.g., "D:/XXX/XXX/Path_Images.txt" to check it.

weiyt2014 commented 10 years ago

test_model.m the line 129-130 "randf = LBFRegModel.ranf; Ws = LBFRegModel.Ws;" Why "not enough input arguments"?train.model.m has obtained " LBFRegModel.ranf = randf; LBFRegModel.Ws = Ws;" I hope to know how to modify the mistake?

Thanks very much!

jwyang commented 10 years ago

Hi, this is a debug issue, I think you can solve it by yourself, :)

At 2014-10-17 11:13:15, "weiyt2014" notifications@github.com wrote:

test_model.m the line 129-130 "randf = LBFRegModel.ranf; Ws = LBFRegModel.Ws;" Why "not enough input arguments"?train.model.m has obtained " LBFRegModel.ranf = randf; LBFRegModel.Ws = Ws;" I hope to know how to modify the mistake?

Thanks very much!

— Reply to this email directly or view it on GitHub.