face-alignment icon indicating copy to clipboard operation
face-alignment copied to clipboard

A problem about "Ts_bbox.mat"

Open weiyt2014 opened this issue 10 years ago • 29 comments

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

weiyt2014 avatar Oct 11 '14 00:10 weiyt2014

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" [email protected] 写道:

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.

jwyang avatar Oct 11 '14 02:10 jwyang

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"?

weiyt2014 avatar Oct 11 '14 02:10 weiyt2014

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

jwyang avatar Oct 11 '14 02:10 jwyang

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?

weiyt2014 avatar Oct 11 '14 03:10 weiyt2014

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

jwyang avatar Oct 11 '14 03:10 jwyang

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

jwyang avatar Oct 11 '14 03:10 jwyang

Thanks very much!

weiyt2014 avatar Oct 11 '14 03:10 weiyt2014

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!

weiyt2014 avatar Oct 11 '14 05:10 weiyt2014

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

jwyang avatar Oct 11 '14 11:10 jwyang

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

weiyt2014 avatar Oct 12 '14 13:10 weiyt2014

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

weiyt2014 avatar Oct 12 '14 13:10 weiyt2014

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

weiyt2014 avatar Oct 12 '14 13:10 weiyt2014

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

jwyang avatar Oct 12 '14 15:10 jwyang

Error in derivebinaryfeat (line 15) dims_binfeat = 0;

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

weiyt2014 avatar Oct 13 '14 00:10 weiyt2014

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" [email protected] 写道:

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.

jwyang avatar Oct 13 '14 01:10 jwyang

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?

weiyt2014 avatar Oct 13 '14 02:10 weiyt2014

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" [email protected] 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.

jwyang avatar Oct 13 '14 02:10 jwyang

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!

weiyt2014 avatar Oct 13 '14 03:10 weiyt2014

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

At 2014-10-13 11:21:43, "weiyt2014" [email protected] 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.

jwyang avatar Oct 13 '14 03:10 jwyang

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!

weiyt2014 avatar Oct 13 '14 08:10 weiyt2014

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" [email protected] 写道:

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.

jwyang avatar Oct 13 '14 10:10 jwyang

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!

weiyt2014 avatar Oct 14 '14 09:10 weiyt2014

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" [email protected] 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.

jwyang avatar Oct 14 '14 10:10 jwyang

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?

weiyt2014 avatar Oct 15 '14 08:10 weiyt2014

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" [email protected] 写道:

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.

jwyang avatar Oct 15 '14 10:10 jwyang

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!

weiyt2014 avatar Oct 16 '14 05:10 weiyt2014

@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.

jwyang avatar Oct 16 '14 07:10 jwyang

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!

weiyt2014 avatar Oct 17 '14 03:10 weiyt2014

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

At 2014-10-17 11:13:15, "weiyt2014" [email protected] 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.

jwyang avatar Oct 17 '14 09:10 jwyang