Object Proposal

Object Proposal becomes important as the preprocess component in object detection pipeline.

 

 

Code

We have made some changes on the efficient supervised objectness proposal estimator (BING), in order to make it compatible with Linux/Mac/Windows. The code has been released on the GitHub: https://github.com/bittnt/Objectness.git

FAQ

Please refer to the web: http://mmcheng.net/bing/ for further questions.

Notice: the linux version code has been tested on Ubuntu/mac osx, but you might find more errors, mainly due to the inconsistent setting in the paths. To achieve 1111FPS, you might need to have it running on a good computer (Dell T7600 workstation computer, which has two Intel Xeon E5-2687W (3.1GHz, 1600MHz) and 64 GB 1600MHz DDR3 Memory). You could download the VOC2007 preprocessed annotation files from this link.

1. To run the code, you have to install OpenCV in the your ubuntu linux system.
We specify the dependencies on opencv at

include_directories(/usr/local/include)
link_directories(/usr/local/lib)

2. You can use/debug/change the code with Qt Creator IDE on ubuntu/mac.

3. “Invalidate class name in /home/yukin/dev/Objectness/Src/DataSetVOC.cpp:125 OpenCV Error: Assertion failed (Invalidate class name ) in loadBox, file /home/yukin/dev/Objectness/Src/DataSetVOC.cpp, line 125 terminate called after throwing an instance of ‘cv::Exception’ what(): /home/yukin/dev/Objectness/Src/DataSetVOC.cpp:125: error: (-215) Invalidate class name
in function loadBox Aborted I tracked into the code and found out that the fName extracted in the loadBBoxes function seems to be wrong: ‘MYDATAPATH/Annotations/00000.yml’. And it seems like ”ImageSets/Main/train.txt” does not exist ”

This message shows that you do not have correct path for the VOC files, or you do not have them in your PC. You need to download all the files properly from VOC website, by which i mean that you need to download all files from:
http://pascallin.ecs.soton.ac.uk/challenges/VOC/voc2007/VOCtest_06-Nov-2007.tar
http://pascallin.ecs.soton.ac.uk/challenges/VOC/voc2007/VOCtrainval_06-Nov-2007.tar
You also need to convert all the xml files into yml. You might find XML2YML tools to do so or you can use the tool we put on here.

4. “OpenCV Error: Assertion failed (matRead(_modelName + “.xP”, xP1f) && matRead(_modelName + “.xN”, xN1f)) in trainStageI, file /home/yukin/dev/Objectness/Src/Objectness.cpp, line 555
terminate called after throwing an instance of ‘cv::Exception’
what(): /home/yukin/dev/Objectness/Src/Objectness.cpp:555: error: (-215) matRead(_modelName + “.xP”, xP1f) && matRead(_modelName + “.xN”, xN1f) in function trainStageI”

This message indicates that you do not have correct path to read the preprocessed positive and negative samples. You might need to use root user to run the program. You might also need to set up the result folder and path correctly.

 

20 thoughts on “Object Proposal

  1. Thanks for the great work!!!
    Unfortunately, I encountered some problems when trying to run the code on Fedora x86_64 with VOC test data directly downloaded from its official website (http://pascallin.ecs.soton.ac.uk/challenges/VOC/voc2007/#testdata). I have changed the main.cpp to adapt to my dataset location. The error message says:

    Invalidate class name
    in /home/yukin/dev/Objectness/Src/DataSetVOC.cpp:125
    OpenCV Error: Assertion failed (Invalidate class name
    ) in loadBox, file /home/yukin/dev/Objectness/Src/DataSetVOC.cpp, line 125
    terminate called after throwing an instance of ‘cv::Exception’
    what(): /home/yukin/dev/Objectness/Src/DataSetVOC.cpp:125: error: (-215) Invalidate class name
    in function loadBox

    Aborted

    I tracked into the code and found out that the fName extracted in the loadBBoxes function seems to be wrong: ‘MYDATAPATH/Annotations/00000.yml’. And it seems like ”ImageSets/Main/train.txt” does not exist. I’m not sure if that is the source of the error message. Thanks again~~

  2. I have exactly the same error. Did you solve it?

  3. As commented in the cvt2OpenCVYml function in DatasetVOC.cpp, we should run an adapted version of yml.m on the VOC2007 dataset, and then run cvt2OpenCVYml function once to convert all the yaml files to yml files in annoDir. In my development environment (Fedora 20 X86_64 with gcc 4.8.2), I need also to remove the line “line.resize(sz – 1)” in loadStrList function in CmFile.cpp to locate the correct file names. The “class.txt” should manually created in “ImageSets/Main/” as follows:

    aeroplane
    bicycle
    bird
    boat
    bottle
    bus
    car
    cat
    chair
    cow
    diningtable
    dog
    horse
    motorbike
    person
    pottedplant
    sheep
    sofa
    train
    tvmonitor

    After that, the VOC dataset seems having been read in successfully. However, I encountered another error message saying:

    Load annotations finished
    Dataset:`/home/yukin/data/VOC/VOCdevkit/VOC2007/’ with 2501 training and 4952 testing
    WinRecall.m Base = 2, W = 8, NSS = 2, perSz = 130
    OpenCV Error: Assertion failed (matRead(_modelName + “.xP”, xP1f) && matRead(_modelName + “.xN”, xN1f)) in trainStageI, file /home/yukin/dev/Objectness/Src/Objectness.cpp, line 555
    terminate called after throwing an instance of ‘cv::Exception’
    what(): /home/yukin/dev/Objectness/Src/Objectness.cpp:555: error: (-215) matRead(_modelName + “.xP”, xP1f) && matRead(_modelName + “.xN”, xN1f) in function trainStageI

    Aborted

    I was really inspired by the paper. Still trying to make the code work in my environment~~(Or may try the other linux version) ^_^

  4. Please check if your result path is correct. You might also need to check if you are root user to write/read from that result path.

  5. please read the FAQ. Thanks.

  6. Thanks. Please read the FAQ.

  7. Hi, Shuai Zheng.
    I was really inspired by your work, It really so great.And I have make it work in my windows platform.But it have some problems in my linux platform.
    I download the source code from https://github.com/bittnt/Objectness#objectness
    and complie it as a executable program named BING_linux.
    However when I ran it, it give some errors.The error messages says:
    Invalidate class name
    in /home/edw/workdir/BING/Objectness-master/Src/DataSetVOC.cpp:125
    OpenCV Error: Assertion failed (Invalidate class name
    ) in loadBox, file /home/edw/workdir/BING/Objectness-master/Src/DataSetVOC.cpp, line 125
    terminate called after throwing an instance of ‘cv::Exception’
    what(): /home/edw/workdir/BING/Objectness-master/Src/DataSetVOC.cpp:125: error: (-215) Invalidate class name
    in function loadBox

    已放弃(吐核)

    I am sure I have download the VOC files that I have used in my windows platform and run the program by root user.
    Also I download the VOC2007 preprocessed annotation files fome the
    http://kylezheng.org/dataset/VOC2007Annotationonly.7z, extract the Annotations folder replace the same name folder within the original VOC files.

    There is an intersting phenomenon, when I changed the route in main.cpp to an error location, the error message would change to :
    Load annotations finished
    Dataset:`/home/edw/workdir/BING/VOCdevkit/VOC20072/’ with 0 training and 0 testing
    WinRecall.m Base = 2, W = 8, NSS = 2, perSz = 130
    Invalidate CvMat data file /home/edw/workdir/BING/VOCdevkit/VOC20072/Results/ObjNessB2W8MAXBGR.xP
    OpenCV Error: Assertion failed (matRead(_modelName + “.xP”, xP1f) && matRead(_modelName + “.xN”, xN1f)) in trainStageI, file /home/edw/workdir/BING/Objectness-master/Src/Objectness.cpp, line 555
    terminate called after throwing an instance of ‘cv::Exception’
    what(): /home/edw/workdir/BING/Objectness-master/Src/Objectness.cpp:555: error: (-215) matRead(_modelName + “.xP”, xP1f) && matRead(_modelName + “.xN”, xN1f) in function trainStageI
    已放弃(吐核)

    and the program would create a new empty folder in the error location.
    I am still trying to make the code work in my linux environment.Hope it run correctly.^_^

  8. Yuki.N, your error
    Load annotations finished
    Dataset:`/home/yukin/data/VOC/VOCdevkit/VOC2007/’ with 2501 training and 4952 testing
    WinRecall.m Base = 2, W = 8, NSS = 2, perSz = 130
    OpenCV Error: Assertion failed (matRead(_modelName + “.xP”, xP1f) && matRead(_modelName + “.xN”, xN1f)) in trainStageI, file /home/yukin/dev/Objectness/Src/Objectness.cpp, line 555
    terminate called after throwing an instance of ‘cv::Exception’
    what(): /home/yukin/dev/Objectness/Src/Objectness.cpp:555: error: (-215) matRead(_modelName + “.xP”, xP1f) && matRead(_modelName + “.xN”, xN1f) in function trainStageI

    if found was solved by typing

    sudo ./BING_LINUX

    instead of just
    ./BING_LINUX

    For some reason the code has write permissions on the ‘results’ folder under voc2007 which is causing the error.

  9. I get the following error. It’s error message is very uninformative. Any ideas?

    Load annotations finished
    Dataset:`/Users/Ivan/Downloads/BING-Objectness-master/VOC2007/’ with 2501 training and 4952 testing
    WinRecall.m Base = 2, W = 8, NSS = 2, perSz = 130
    OpenCV Error: Assertion failed (0 <= roi.x && 0 <= roi.width && roi.x + roi.width <= m.cols && 0 <= roi.y && 0 <= roi.height && roi.y + roi.height <= m.rows) in Mat, file /tmp/opencv-pHCj/opencv-2.4.8.2/modules/core/src/matrix.cpp, line 323
    libc++abi.dylib: terminating with uncaught exception of type cv::Exception: /tmp/opencv-pHCj/opencv-2.4.8.2/modules/core/src/matrix.cpp:323: error: (-215) 0 <= roi.x && 0 <= roi.width && roi.x + roi.width <= m.cols && 0 <= roi.y && 0 <= roi.height && roi.y + roi.height <= m.rows in function Mat

  10. I have the same problem

    nabila@nabila-Precision-M4500:~/Documents/bing/Src/build$ sudo ./BING_linux
    Load annotations finished
    Dataset:`/home/nabila/Documents/bing/VOC2007/’ with 0 training and 0 testing
    WinRecall.m Base = 2, W = 8, NSS = 2, perSz = 130
    Invalidate CvMat data file /home/nabila/Documents/bing/VOC2007/Results/ObjNessB2W8MAXBGR.xP
    OpenCV Error: Assertion failed (matRead(_modelName + “.xP”, xP1f) && matRead(_modelName + “.xN”, xN1f)) in trainStageI, file /home/nabila/Documents/bing/Src/Objectness.cpp, line 555
    terminate called after throwing an instance of ‘cv::Exception’
    what(): /home/nabila/Documents/bing/Src/Objectness.cpp:555: error: (-215) matRead(_modelName + “.xP”, xP1f) && matRead(_modelName + “.xN”, xN1f) in function trainStageI

  11. I was missing testing data. Download training AND testing data from VOC2007. Copy all images from …/testing_folder/JPEGImages and …/training_folder/JPEGImages into one folder ( whose name is also JPEGImages). Download Annotations readable by Opencv ( with .yml extension) and put them into folder whose name is ‘Annotations’. Also edit main.cpp to have correct location of the folders above ( string which is passed to DataSetVOC class instance).

  12. Hello Ivan,
    in the main.cpp
    void RunObjectness(CStr &resName, double base, int W, int NSS, int numPerSz)
    {
    srand((unsigned int)time(NULL));
    DataSetVOC voc2007(“/home/nabila/Documents/bing/VOC/JPEGImages/”);
    voc2007.loadAnnotations();
    //voc2007.loadDataGenericOverCls();

    Please tell me if i’m right ?
    in the VOC folder i have two folders one named Annotations (.yml) and ine named JPEGImages wich containing training and testing images.

  13. You should set
    DataSetVOC voc2007(“/home/nabila/Documents/bing/VOC/”);

    provided annotations are in “/home/nabila/Documents/bing/VOC/Annotations” and images are in “/home/nabila/Documents/bing/VOC/JPEGImages/”

  14. The requirement for root permission for reading local/ and results/ can be solved by simply by changing an argument in CmFile::Mkdir. Requiring sudo is impractical on most setups.

    mkdir(buffer, 0) -> mkdir(buffer, 0755)
    mkdir(_S(_path), 0) -> mkdir(_S(_path), 0755)

    This gives drwxr-xr-x for both folders.

    Other than this small issue, great work!

  15. I run on ubuntu 14.04.3 LTS (gcc 4.8.4, opencv 3.0 ) with a personal computer, which has one Inel i7-4790k(4.0GHz) and 16G 1866MHz DDR3 Memory. It encountered the following error:

    *: ~/*/Objectness-master/Src$ ./BING_linux
    Load annotations finished
    Dataset:`/home/dl/gds/project/VOC2007/’ with 2501 training and 4952 testing
    WinRecall.m Base = 2, W = 8, NSS = 2, perSz = 10
    Floating point exception (core dumped)

    Any ideas?

  16. hello,MingLiang Ma on ,I meet the same problems with you ,Did you solve it? Please tell me how to solve the problem.

  17. “Invalidate class name in /home/yukin/dev/Objectness/Src/DataSetVOC.cpp:125 OpenCV Error: Assertion failed (Invalidate class name ) in loadBox, file /home/yukin/dev/Objectness/Src/DataSetVOC.cpp, line 125 terminate called after throwing an instance of ‘cv::Exception’ what(): /home/yukin/dev/Objectness/Src/DataSetVOC.cpp:125: error: (-215) Invalidate class name

    this proble may be caused by the line break ,in windows the line break is \r\n in the line break is \r
    so when parse the classes.txt different line break may cause the program not work.
    so the solution is to check your txt files in VOC2007/ ImageSet/main/

  18. “Invalidate class name in /home/yukin/dev/Objectness/Src/DataSetVOC.cpp:125 OpenCV Error: Assertion failed (Invalidate class name ) in loadBox, file /home/yukin/dev/Objectness/Src/DataSetVOC.cpp, line 125 terminate called after throwing an instance of ‘cv::Exception’ what(): /home/yukin/dev/Objectness/Src/DataSetVOC.cpp:125: error: (-215) Invalidate class name

    this problem may be caused by the line break ,in windows the line break is \r\n in unix the line break is \r
    so when parse the classes.txt, different line break may cause the program not work.
    so the solution is to check your txt files in VOC2007/ ImageSet/main/ to confirm the line break is the windows style or the unix style line break

  19. If you are interested in topic: earn dollars clicking
    ads for cash – you should read about Bucksflooder first

Leave a Reply

Your email address will not be published.

Website