vlfeat / matconvnet

MatConvNet: CNNs for MATLAB
Other
1.4k stars 752 forks source link

Trying to use vgg_face model kindly help. #624

Open talha196 opened 8 years ago

talha196 commented 8 years ago

So i am trying to run the code in the demo.m file in the zipped file heres the error that i cant figure out.

config.paths.net_path = 'vgg_face_matconvnet/data/vgg_face.mat'; convNet = lib.face_feats.convNet(config.paths.net_path); img = imread('ak.jpg'); det = faceDet.detect(img); Error using lib.face_detector.dpmCascadeDetector/resize Method 'resize' is not defined for class 'lib.face_detector.dpmCascadeDetector' or is removed from MATLAB's search path. Error in lib.face_detector.dpmCascadeDetector/featpyramid (line 42) scaled = obj.resize(im, 1/sc^(i-1)); Error in lib.face_detector.dpmCascadeDetector/detect (line 7) pyra = obj.featpyramid(double(im));

if i try to run the code of examples/cnn_vgg_faces in matconvnet folder i get this

net = load('data/vgg_face.mat') ; im = imread('https://upload.wikimedia.org/wikipedia/commons/4/4a/Aamir_Khan_March_2015.jpg') ; im = im(1:250,:,:) ; % crop

im = single(im) ; % note: 255 range im = imresize(im_, net.meta.normalization.imageSize(1:2)) ; Reference to non-existent field 'meta'

i cant figure out this meta thing either. However the same code worked fine if i used imagenet_vgg_f model. Kindly help please

wajihullahbaig commented 8 years ago

This happens because you need to compile resize.cc along with some other C code files. There is a makefile under \vgg_face_matconvnet+lib+face_detector\@dpmCascadeDetector which needs to used to complete the build and produce mex files. If you are on windows you wont be able to compile these C files. Try Linux/Mac... The readme with the project was helpful :)

Ashraf90 commented 7 years ago

I changed the path in the makefile, but I didn't know how to use "make" to compile it! I would appreciate it if you can suggest a solution for the resize problem on windows!!