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

Could not LoadSamples

Open TrueBlue10 opened this issue 9 years ago • 4 comments

Hello @jwyang , I'm trying to run your matlab code on my machine now. But I met some issue when I tried to load the image in. in the test_model file, after I ran the code "te_data = loadsamples(imgpathlistfile, 1);" the data returned is always "Empty cell array: 0-by-1"; Could you please provide me some information on it? Thank you

TrueBlue10 avatar Mar 10 '16 10:03 TrueBlue10

Hi, @TrueBlue10

I think it could be caused by the incorrect format of 'imgpathlistfile'? It should be cell data, looks like {'lfw'} or so. Did you use the same format?

jwyang avatar Mar 11 '16 02:03 jwyang

@jwyang Thanks for your information.I'm using {'afw'} as my testing database. Because of some unknown reason, the command Data = cell(length(imgpathlist), 1); always create an 0*1 cell. I split the code into lgh = length(imgpathlist); Data = cell(lgh, 1); it could create a 377 * 1 cell now.

But new error comes. when I run img = im2uint8(imread(imgpathlist{i}));the im2uint8 function always give me an exceptions says that 未定义与 'uint8' 类型的输入参数相对应的函数 'im2uint8'。(undefined function for im2uint8 using uint8 as variable)(loadsamples (line 22)). I thought this was because imread(imgpathlist{i}) was already in uint8. so I just remove im2uint8 function. But it will give me an error afterwards shows 未定义与 'double' 类型的输入参数相对应的函数 'fitgeotrans'。 in code Data{i}.tf2meanshape{1} = fitgeotrans(bsxfun(@minus, Data{i}.intermediate_shapes{1}(1:end,:, 1), mean(Data{i}.intermediate_shapes{1}(1:end,:, 1))), ... (test_model (line 114))which means the data I load is in double format. It's really confused to me now. My word is a little messy. Please let me know if I didnt explain myself clearly. Really appreciate for your help.

TrueBlue10 avatar Mar 11 '16 08:03 TrueBlue10

Hi, @TrueBlue10 ,

as mentioned in the readme file, *fitgeotrans * command may not be supported for soime versions of matlab, I think you may need to do following alternations:

fitgeotrans -> cp2tform, transformPointsForward -> tformfwd

jwyang avatar Mar 12 '16 02:03 jwyang

Hello @jwyang, Unfortunately, changing the function didnt solve the problem. I'm using Matlab R2015b. I'll keep digging what happen on my machine. thank you.

TrueBlue10 avatar Mar 14 '16 02:03 TrueBlue10