Giter Club home page Giter Club logo

rbgirshick / voc-dpm Goto Github PK

View Code? Open in Web Editor NEW
576.0 576.0 311.0 34.35 MB

Object detection system using deformable part models (DPMs) and latent SVM (voc-release5). You may want to use the latest tarball on my website. The github code may include code changes that have not been tested as thoroughly and will not necessarily reproduce the results on the website.

Home Page: http://www.cs.berkeley.edu/~rbg/latent/

License: MIT License

MATLAB 68.86% C++ 31.12% Makefile 0.03%

voc-dpm's People

Contributors

rbgirshick avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

voc-dpm's Issues

failed to compile in mac os10.11, fv_cached compilation failed

When running your compile.m, I see this warning
Warning: Maybe you need to call fv_cache('unlock') first?

In fv_compile (line 52)
In compile (line 48)
which means I can not successfully compile fv_cache.cc function.
I saw your comment in this exception, but I don't know how to solve this problem.
There is one guy in stack overflow suggested that he has met the same problem, and he solve it by installing gcc48.
http://stackoverflow.com/questions/24150718/voc-release-5-demo-m-is-not-working/33789824#33789824
Is that the correct way?

error in cascade_compile

systems
Ubuntu
Matlab r2020b
gcc 9.3

While running the compile.m following error shows

Building with 'g++'.
/home/nasim/Desktop/voc-release5/2012/voc-dpm/fv_cache/fv_cache.cc: In function ‘void gradient_handler(int, mxArray**, int, const mxArray**)’:
/home/nasim/Desktop/voc-release5/2012/voc-dpm/fv_cache/fv_cache.cc:417:21: warning: narrowing conversion of ‘dim’ from ‘int’ to ‘mwSize’ {aka ‘long unsigned int’} [-Wnarrowing]
417 | mwSize dims[] = { dim };
| ^~~
/home/nasim/Desktop/voc-release5/2012/voc-dpm/fv_cache/fv_cache.cc: In function ‘void get_model_handler(int, mxArray**, int, const mxArray**)’:
/home/nasim/Desktop/voc-release5/2012/voc-dpm/fv_cache/fv_cache.cc:510:23: warning: narrowing conversion of ‘(int)M.model::num_blocks’ from ‘int’ to ‘mwSize’ {aka ‘long unsigned int’} [-Wnarrowing]
510 | mwSize dims[] = { M.num_blocks };
| ~~^~~~~~~~~~
/home/nasim/Desktop/voc-release5/2012/voc-dpm/fv_cache/fv_cache.cc:515:38: warning: narrowing conversion of ‘(((int)M.model::block_sizes) + ((sizetype)(((long unsigned int)i) * 4)))’ from ‘int’ to ‘mwSize’ {aka ‘long unsigned int’} [-Wnarrowing]
515 | mwSize dims[] = { M.block_sizes[i] };
| ~~~~~~~~~~~~~~~^

MEX completed successfully.
Building with 'g++'.
Error using mex
/home/nasim/Desktop/voc-release5/2012/voc-dpm/star-cascade/cascade.cc: In function ‘double conv(int, int,
const float*, const mwSize*, const float*, const mwSize*, int)’:
/home/nasim/Desktop/voc-release5/2012/voc-dpm/star-cascade/cascade.cc:62:25: warning: comparison of integer
expressions of different signedness: ‘int’ and ‘const mwSize’ {aka ‘const long unsigned int’}
[-Wsign-compare]
62 | for (int xp = 0; xp < B_dims[1]; xp++) {
| ~~~^~~~~~~~~~~
/home/nasim/Desktop/voc-release5/2012/voc-dpm/star-cascade/cascade.cc: In function ‘double rconv(int, int,
int, int, int)’:
/home/nasim/Desktop/voc-release5/2012/voc-dpm/star-cascade/cascade.cc:97:43: error: cannot convert ‘int*’
to ‘const mwSize*’ {aka ‘const long unsigned int*’} in initialization
97 | const mwSize A_dims = MODEL->featdims[L];
| ~~~~~~~~~~~~~~~~~^
| |
| int

/home/nasim/Desktop/voc-release5/2012/voc-dpm/star-cascade/cascade.cc: In function ‘double pconvdt(int,
int, int, int, int, int, int, int, int, int, double)’:
/home/nasim/Desktop/voc-release5/2012/voc-dpm/star-cascade/cascade.cc:116:43: error: cannot convert ‘int*’
to ‘const mwSize*’ {aka ‘const long unsigned int*’} in initialization
116 | const mwSize A_dims = MODEL->featdims[L];
| ~~~~~~~~~~~~~~~~~^
| |
| int

/home/nasim/Desktop/voc-release5/2012/voc-dpm/star-cascade/cascade.cc: In function ‘double partscore(int,
int, int, int, int, int, double)’:
/home/nasim/Desktop/voc-release5/2012/voc-dpm/star-cascade/cascade.cc:195:43: error: cannot convert ‘int*’
to ‘const mwSize*’ {aka ‘const long unsigned int*’} in initialization
195 | const mwSize A_dims = MODEL->featdims[L];
| ~~~~~~~~~~~~~~~~~^
| |
| int

Error in cascade_compile (line 55)
eval(mexcmd);

Error in compile (line 44)
cascade_compile(opt, verb);

Some questions about training process

Hi,
I am a little confused in the process of training:
1. What's the meaning of "belief" in your code?
2. Does ex mean a picture and does fv mean one object in that picture?
3. Where's the code for optimizing param z of negative? And where's the code for training best location z?
4. What's the role of using the loss pyramid playing in your code?
Thank you for your answer. I spend a lot of time to read your code, and I really need some clues. Can you answer in detail?
best wishes,
MX

Error in testing in some images

Even though the testing algorithm in the demo works perfectly for some images, for some others it's not working well and produces an error.

In particular, the error is in reduceboxes function (in util folder). In some images the size(bs)=[0,0] so it cannot access those.

Error using mex

Hello, sorry if it's lame issue, but when I try to compile or make, I got an error using mex.
Error in cascade_compile (line 55)
eval(mexcmd)
Error in compile (line 64)
cascade_compile(opt,verb);

I really don't know what to do to get the demo working i would love id you can help me.

PCA Scores, train on my own dataset

Hi everyone,

I successfully trained a model on my own dataset, but when try to uses cascade detection I got an error about pca score files. How can i generate socres for my dataset to use in cascade detection?

Relationship of this project to the Latent SVM module in OpenCV

Hey there!

Because I could not find your email adress to contact you directly I am doing it here now:

Could you please state something about the relationship between voc-dpm and http://docs.opencv.org/master/modules/objdetect/doc/latent_svm.html? Maybe in the Wiki or Readme here or at OpenCV.

As far as I see, you can not train a model with the software included in OpenCV. This is why I came here. Am I right?

Thanks for your great work!

A little confused to the code

Hey:

  1. Your paper suggests that there are two functions need to be optimizated. One is to minimize, another is to maximize. I can only find the minimize procedure. Where is the maximize procedure?
  2. When add part filters, you set the 31-th dim to zero, and give the note:" remove image boundary truncation weights". I can't get your idea, and don't know why.
  3. If I want to use other features(not HOG) in your program for test, what should I do. Just need to change the features.cc file?
    thank you!

Regarding the frequent occurrence of “NaN” during training?

I‘m training by some grayscale images。
Last time I used 70 positive samples and 10 negative samples to train a detectable model。
But this time i use some other grayscale images for training (50:20, 120:20), a lot of NaN will appear during the training process
image
image
Does anyone know what is causing this?

how to generate myself pca.mat

I have trained an myself cascade model using author's pca.mat. But i think it is unreasonable, how can i generate myself pca.mat.

Documentation of the model datatype

Hi!

I can't find a explanation of the different fields of the Matlab model datatype and its relations, which would be very nice for understanding.

model = 

         class: 'ExampleModel'
          year: '2014'
          note: '29.Apr.2014:09.09.13'
       filters: [1x108 struct]
         rules: {1x222 cell}
       symbols: [1x222 struct]
    numfilters: 108
     numblocks: 228
    numsymbols: 222
         start: 1
       maxsize: [17 7]
       minsize: [11 5]
      interval: 10
          sbin: 8
        thresh: 0.9999
          type: 'M'
        blocks: [1x228 struct]
      features: [1x1 struct]
         stats: [1x1 struct]
      bboxpred: {12x1 cell}

Invalid MEX-file 'fv_cache.mexa64': dlopen: cannot load any more object with static TLS

Hello, I want to try voc-realse 5.0, but when I run "pascal('bicycle', 3);", I encounter the following error:

Caching features
cluster objective: 6285.721
cluster objective: 6285.721
cluster iter: 23/25
Invalid MEX-file
'/home/jeremy/jWork/voc-dpm-master/bin/fv_cache.mexa64': dlopen:
cannot load any more object with static TLS

Error in train (line 76)
fv_cache('init', max_num, max_dim, max_nbls);

Error in pascal_train (line 71)
models{i} = train(models{i}, spos{i}(inds), neg_large, true,
true, 1, 1, ...

Error in pascal (line 62)
model = pascal_train(cls, n, note);

can someone help me?

Array Index overflow issue.

parsing model
??? Subscript indices must either be real positive integers or logicals.

Error in ==> train at 217
model.thresh = pos_vals(ceil(length(pos_vals)*0.05));

Compilation fails under Matlab x64 R2014a, linux

Hello, I don't know so much about MEX compilation, excuse the naiveness of my issue

I tried to compile the toolkit under linux x64 and matlab R2014a.

The first error I encountered was that the -o arguments in MEX calls from compile.m were not valid mex arguments. I replaced them by -output arguments, which worked.

Then I got another error : in verbose mode, I get

/usr/bin/g++ -c -DMX_COMPAT_32   -D_GNU_SOURCE -DMATLAB_MEX_FILE  -I"/usr/local/MATLAB/R2014a/extern/include" -I"/usr/local/MATLAB/R2014a/simulink/include" \"\-ansi -fexceptions -fPIC -fno-omit-frame-pointer -pthread -Wall -fopenmp" -Iexternal -DMETA_NUM_FEATURES=8 -O3 -DNDEBUG /home/maxim/Documents/voc-dpm-master/gdetect/fconv_sse_meta.cc -o /tmp/mex_299675772102824_29533/fconv_sse_meta.o

/tmp/mex_299675815106937_29533: 3: /tmp/mex_299675815106937_29533: Syntax error: Unterminated quoted string

I could not easily investigate the contents of this /tmp/mex_299675815106937_29533 file because it was deleted upon termination of the mex compilation. I finally ran an infinite loop that copied the mex temporary files in another folder in parallel to inspect its contents:

#!/bin/sh
/usr/bin/g++ -c -DMX_COMPAT_32   -D_GNU_SOURCE -DMATLAB_MEX_FILE  -I"/usr/local/MATLAB/R2014a/extern/include" -I"/usr/local/MATLAB/R2014a/simulink/include" \"\-ansi -fexceptions -fPIC -fno-omit-frame-pointer -pthread -Wall -fopenmp" -Iexternal -DMETA_NUM_FEATURES=8 -O3 -DNDEBUG /home/maxim/Documents/voc-dpm-master/gdetect/fconv_sse_meta.cc -o /tmp/mex_299675772102824_29533/fconv_sse_meta.o > /tmp/mex_299675815124147_29533 2> /tmp/mex_299675815135458_29533

Can somebody help me understand what is wrong with this file, how and where to fix it ?

Many thanks
(PS: I also posted on mathworks forums http://www.mathworks.fr/matlabcentral/answers/130370-how-can-i-debug-this-failed-mex-compilation)

compile error in compile.m file

I couldn't compile the project due to following error.
Error using mex
voc-release5/fconv not found; check that you are in the correct current folder, and check the spelling of '/.../voc-release5/fconv'

Error in compile (line 64)
eval([mexcmd 'gdetect/fconvsse.cc -o fconv']);

I am using matlabr2015a on ubuntu 15.10.
Thanks.

very large size of array

After getting compile the files, the demo run provides this output shown below:

demo
input image
press any key to continue
continuing...
car model visualization
press any key to continue
continuing...

Error using resize
Requested 480x640x257612297838540 (17179869184.0GB) array exceeds maximum array size
preference. Creation of arrays greater than this limit may take a long time and cause
MATLAB to become unresponsive. See array size limit or preference panel for more
information.

Error in featpyramid (line 31)
scaled = resize(im, 1/sc^(i-1));

Error in imgdetect (line 15)
pyra = featpyramid(input, model);

Error in demo>test (line 31)
[dets, boxes] = imgdetect(im, model, -0.3);

Error in demo (line 4)
test('000034.jpg', model);

error occur when train with my own data

I encountered an error when learning from my own data. I think it relates to the parallel computing part.

Error using parallel_function (line 604)
All workers aborted during execution of the parfor loop.

Error in train>poslatent (line 503)
parfor k = 1:thisbatchsize

Error in train (line 113)
= poslatent(t, iter, model, pos, fg_overlap, num_fp);

Error in pascal_train (line 76)
models{i} = train(models{i}, spos{i}, neg_small, false, false, 4, 3, ...

Error in pascal (line 49)
model = pascal_train(cls, n, note);

The client lost connection to worker 1. This might be due to network problems, or the interactive communicating job might have errored.

I am using ubuntu14.04 with matlab2015b.

I did check the log file but didn't figure it out what's the cause. Any ideas? Thanks.

compile fails on el capitan

Im getting the error "matlab/voc-dpm/gdetect/fconv_sse_meta.cc:22:10: fatal error:
'boost/preprocessor/repeat.hpp' file not found

include <external/boost/preprocessor/repeat.hpp>"

I see the file is there so I am curious if there is something in the setup on the Mac that I am missing.

Invalid MEX-file "resize.mexa64":failed to map segment from shared object

I have met a problem when I run the demo.m, and the error informations are as follows:

 ///// Running demo for car /////
input image
press any key to continue
continuing...
car model visualization
press any key to continue
continuing...

Invalid MEX-file
'/media/ExtHDD/ygj/EclipseWorkspace/cachedir/voc-dpm-master/bin/resize.mexa64':
/media/ExtHDD/ygj/EclipseWorkspace/cachedir/voc-dpm-master/bin/resize.mexa64:
failed to map segment from shared object

Error in featpyramid (line 56)
  scaled = resize(im, 1/sc^(i-1));

Error in imgdetect (line 25)
pyra = featpyramid(im, model);

Error in demo>test (line 67)
[ds, bs] = imgdetect(im, model, -1);

Error in demo (line 27)
test('000034.jpg', model, 1);

My environment:

  • ubuntu 16.04
  • MATLAB R2014b
  • gcc 5.4.0

Does anyone know how to solve it? Thanks in advance.

error running script compile.m on windows , matlab2015

I am trying to run the compile script on a windows machine , with MATLAB 2015.

However, I am facing the following error with the compile.m script:

>> compile
Building with 'Microsoft Visual C++ 2013 Professional'.
Error using mex
resize.cc 
C:\Users\Pallavi\Documents\Khimya\voc-release3.1\resize.cc(36) : error C2057: expected        constant expression
C:\Users\Pallavi\Documents\Khimya\voc-release3.1\resize.cc(36) : error C2466: cannot allocate   an array of constant size 0
C:\Users\Pallavi\Documents\Khimya\voc-release3.1\resize.cc(36) : error C2133: 'ofs' : unknown size
C:\Users\Pallavi\Documents\Khimya\voc-release3.1\resize.cc(70) : error C3861: 'bzero': identifier not found

Error in compile (line 1)
mex -O resize.cc

I did follow the read me and tried all three convolution options as mentioned in step 3
"(you may need to edit compile.m to use a different convolution routine depending on your system) "

Could you please suggest if this code would work in windows ? Also, how could one fix the above issue ? It will be of great help. Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.