Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to train BING model? #295

Closed
erogol opened this issue Jul 7, 2015 · 12 comments
Closed

How to train BING model? #295

erogol opened this issue Jul 7, 2015 · 12 comments
Labels
question (invalid tracker) ask questions and other "no action" items here: https://forum.opencv.org/

Comments

@erogol
Copy link

erogol commented Jul 7, 2015

I try to come up with a new BING model. Could you guide me to do so ? I guess I need to use svmlight like library and export the trained model compatible with the expected format by BING interface.

@lenlen
Copy link
Contributor

lenlen commented Jul 7, 2015

/cc @fpuja

@fpuja
Copy link
Contributor

fpuja commented Jul 21, 2015

Hi @erogol , sorry for the late reply. The OpenCV version of BING algorithm coded by me, comes with an already trained model on PASCAL VOC 2007 dataset, which comprises 10.000 images more o less, and it is quite versatile and robust to detect a large number of objects and people.

If you have necessity to create your trained model for specific purposes, you can do in this way:
As I think you have seen, there isn't yet a specific function to do that in a OpenCV saliency framework; so, you must use the original code of BING (or this version https://github.com/bittnt/Objectness) to train your module.
In a objectness.h and .cpp file, search the "trainObjectness"; follow the code flow to understand how to do the whole procedure to obtain your trained module (there are some other functions involved in the process: trainStageI, trainSVM, trainStateII ).
It's a bit tricky the first time, but feasible. Pay attention to set the correct paths for image, label and so on.

I hope I was helpful.

Best,

Francesco.

/cc @lenlen

@mshabunin mshabunin added the question (invalid tracker) ask questions and other "no action" items here: https://forum.opencv.org/ label Nov 17, 2015
@yixiao1987
Copy link

yixiao1987 commented Mar 2, 2017

Hi @fpuja , recently I tested your implementation of BING algorithm using mexopencv in MATLAB.
I ranked the proposals according to their objectness scores, and choose to plot the top-ranked bounding boxes in the image. According to the description in http://docs.opencv.org/3.0-beta/modules/saliency/doc/objectness_algorithms.html, "The bigger value these scores are, it is more likely to be an object window." However, as I observed, most often these bounding boxes are from the same quantized size, and do not contain any ground truth objects or have poor overlaps. So basically, the objectness scores output from BING do not seem to work as expected. Could you please give me some suggestions? Thanks!

@animetrics
Copy link

@yixiao1987 did you have any better success? I'm seeing similar issues. @fpuja, any insight?
Thanks

@animetrics
Copy link

I should add that I'm working with opencv 3.2.0 release (and hence 3.2.0 tag of opencv_contrib)

@animetrics
Copy link

I think one issue is that the documentation says that top-ranked bounding boxes are highest scores, but it looks like the scores are costs so it's actually the opposite?

@yixiao1987
Copy link

@animetrics No, I have stopped investigation on BING algorithm. But it would be interesting to see if someone gets obviously better results.

@animetrics
Copy link

@yixiao1987 Ok, can you clarify what question your answer "No" is to? I do believe that lower scores are better. In fact, they are returned in ascending order, so first 10 would be lowest 10 scores.

@yixiao1987
Copy link

@animetrics By "no", I mean I do not have any better success. I have tried to re-order the bounding boxes to make sure that they are listed in descending order (with respect to their corresponding scores), and then to use the top-ranked bounding boxes after re-ordering, but I don't think they are really better.

@animetrics
Copy link

@yixiao1987 sorry, let me clarify. When I call computeSaliency, I'm supposed to get a set of bounding boxes that are sorted with largest scoring boxes first. However, if I subsequently call getobjectnessValues(), the values returned are actually ascending. Is that a bug?

@yixiao1987
Copy link

@animetrics I am not sure if this is a bug. The returned values from getObjectnessValues() do not seem like score to me. The values are all integers, and some values are pretty large, if I remember correctly. In our previous investigation on objectness methods, EdgeBox produces much better and reasonable results than BING and BING++ on our own data.

@animetrics
Copy link

@yixiao1987 sorry, I meant to direct these questions to @fpuja as the one who coded this module.

allnes pushed a commit to allnes/opencv_contrib that referenced this issue Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question (invalid tracker) ask questions and other "no action" items here: https://forum.opencv.org/
Projects
None yet
Development

No branches or pull requests

7 participants