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

Mutiprocessing could be faster #16

Open
dongxijia opened this issue Oct 11, 2019 · 0 comments
Open

Mutiprocessing could be faster #16

dongxijia opened this issue Oct 11, 2019 · 0 comments

Comments

@dongxijia
Copy link

dongxijia commented Oct 11, 2019

Thanks for your codes, it really helps.
And I notices the 60 line code in AdaBoost.py:
votes[i, :] = np.array(list(pool.map(partial(_get_feature_vote, image=images[i]), features)))
It maybe accurs error because pool.map would mix the order of feature,
while the 89 line in AdaBoost.py usd the feature as below, but features' order may differ from votes[i, ;], :
best_feature = features[best_feature_idx]

I noticed using pool.map(partial(_cal_feature, features), image_faces) and pool.map(partial(_cal_feature, features), image_no_faces) can handle this problem and make full use of cpu. The training time will reduce from 30s to 8s in my 6 CPU compute.
The details you can see in my Pull requests.

@dongxijia dongxijia changed the title Mutiprocessing speed can be faster Mutiprocessing could be faster Oct 11, 2019
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

1 participant