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

opencv_traincascade "Can not get new positive sample" -> figure num samples automagically #2

Open
Silex opened this issue Mar 20, 2014 · 1 comment

Comments

@Silex
Copy link
Contributor

Silex commented Mar 20, 2014

Hello,

Based on a discussion on the forum, opencv_traincascade often fails because you have to guess the number of samples and pass numPos about 90% of the sample for it to work.

The error is pretty cryptic like "Can not get new positive sample. The most possible
reason is insufficient count of samples in given vec-file."

Here are links about how to tackle this:

http://stackoverflow.com/questions/10863560/haar-training-opencv-assertion-failed
http://code.opencv.org/issues/1834

Just creating this issue for others and maybe a PR will eventually come.

@Silex Silex changed the title train_cascade "Can not get new positive sample" -> figure num samples automagically opencv_traincascade "Can not get new positive sample" -> figure num samples automagically Mar 20, 2014
@lastessa
Copy link

Command didn't work at last step train.
./prep.py train
TRAIN
Traceback (most recent call last):
File "./prep.py", line 170, in
num_neg_samples = file_len(NEGATIVE_INFO_FILE)
File "./prep.py", line 54, in file_len
return i + 1
UnboundLocalError: local variable 'i' referenced before assignment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants