peiyunh / tiny

Tiny Face Detector, CVPR 2017
https://cs.cmu.edu/~peiyunh/tiny
Other
1.13k stars 319 forks source link

About the function 'nms_mex' #19

Closed ujjaldas1997 closed 7 years ago

ujjaldas1997 commented 7 years ago

Hello Peiyunh, I am using your code in matlab r2014a. I have encountered the stated issues and rectified them. After that, I have faced a new issue which I can't fixed even though searching online. When running this -- _bboxes = tiny_facedetector('data/demo/selfie.jpg', './selfie.png', 0.5, 0.1, 1) I found the following error

Loading pretrained detector model...
Processing data/demo/selfie.jpg at scale 0.031250.
Error using vl_nnconv
An input is not a numeric array (or GPU support not
compiled).

Error in dagnn.Conv/forward (line 11)
      outputs{1} = vl_nnconv(...

Error in dagnn.Layer/forwardAdvanced (line 85)
      outputs = obj.forward(inputs,
      {net.params(par).value}) ;

Error in dagnn.DagNN/eval (line 91)
  obj.layers(l).block.forwardAdvanced(obj.layers(l)) ;

Error in tiny_face_detector (line 130)
  net.eval(inputs);

As I am using CPU version of matconvnet so I changed gpu = 0 as -- _bboxes = tiny_facedetector('data/demo/selfie.jpg', './selfie.png', 0.5, 0.1, 0) The error is

Loading pretrained detector model...
Processing data/demo/selfie.jpg at scale 0.031250.
Processing data/demo/selfie.jpg at scale 0.062500.
Processing data/demo/selfie.jpg at scale 0.125000.
Processing data/demo/selfie.jpg at scale 0.250000.
Processing data/demo/selfie.jpg at scale 0.500000.
Processing data/demo/selfie.jpg at scale 1.000000.
Processing data/demo/selfie.jpg at scale 1.414214.
Processing data/demo/selfie.jpg at scale 2.000000.
Undefined function 'nms_mex' for input arguments of type
'double'.

Error in nms (line 43)
    pick = nms_mex(double(boxes), double(overlap));

Error in tiny_face_detector (line 172)
ridx = nms(bboxes(:,[1:4 end]), nms_thresh);

I am unable to fix this. Please answer my question. Thank you.

ujjaldas1997 commented 7 years ago

I just found out the issue. Ignore this issue.

thenighthunter0 commented 7 years ago

hello ujjaldas1997 , I meet the same issue,Do you fix it now? Cause I’m a beginner,I don't know what to do,can you give me more details? thank you.

ujjaldas1997 commented 7 years ago

I have just compiled nms in matlab. The change I have made is as --(in the file /tiny/toolbox/nms/nms.m)

if size(boxes, 1) < 1000000
            mex -O -outdir bin ...
          CXXFLAGS="\$CXXFLAGS -std=c++11"  ...
          -largeArrayDims ...
          toolbox/nms/nms_mex.cpp ...
          -output C:\Users\ujjal\tiny\nms_mex;
    %mex nms_mex.cpp;
    pick = nms_mex(double(boxes), double(overlap));
    return;
end

Change the file path according to your file tree. And then try to run.

elsiraj commented 3 years ago

As I am using CPU version of matconvnet so I changed gpu = 0 as -- bboxes = tiny_face_detector(image_path, output_path, prob_thresh, nms_thresh, gpu_id) The error is Processing C:\Users\Asirajdin\Documents\T Chapters\Face Detection JKJJ\P04_06.png at scale 0.015625. Processing C:\Users\Asirajdin\Documents\T Chapters\Face Detection JKJJ\P04_06.png at scale 0.031250. Processing C:\Users\Asirajdin\Documents\T Chapters\Face Detection JKJJ\P04_06.png at scale 0.062500. Processing C:\Users\Asirajdin\Documents\T Chapters\Face Detection JKJJ\P04_06.png at scale 0.125000. Processing C:\Users\Asirajdin\Documents\T Chapters\Face Detection JKJJ\P04_06.png at scale 0.250000. Processing C:\Users\Asirajdin\Documents\T Chapters\Face Detection JKJJ\P04_06.png at scale 0.500000. Processing C:\Users\Asirajdin\Documents\T Chapters\Face Detection JKJJ\P04_06.png at scale 1.000000. Processing C:\Users\Asirajdin\Documents\T Chapters\Face Detection JKJJ\P04_06.png at scale 1.414214. Unrecognized function or variable 'nms'.

Error in tiny_face_detector (line 173) ridx = nms(bboxes(:,[1:4 end]), nms_thresh); Please I need somebody's help