Repository navigation
Add flushing to printing number of processed positive/negative samples so that user is informed of updates quicker - #13709
Conversation
alalek
left a comment
There was a problem hiding this comment.
This patch should go into 3.4 branch first. We will merge changes from 3.4 into master regularly (weekly/bi-weekly).
So, please:
- change "base" branch of this PR: master => 3.4 (use "Edit" button near PR title)
- rebase your commits from master onto 3.4 branch. For example:
git rebase -i --onto upstream/3.4 upstream/master
(check list of your commits, save and quit (Esc + "wq" + Enter)
whereupstreamis configured by following this GitHub guide and fetched (git fetch upstream). - push rebased commits into source branch of your fork (with
--forceoption)
Note: no needs to re-open PR, apply changes "inplace".
| { | ||
| getcount++; | ||
| printf("%s current samples: %d\r", isPositive ? "POS":"NEG", getcount); | ||
| std::cout << (isPositive ? "POS" : "NEG") << " current samples: " << getcount << "\r" << std::flush; |
There was a problem hiding this comment.
Consider using this:
printf(...); fflush(stdout);
There was a problem hiding this comment.
@alalek, I have no opportunity to test that C-style version now. Would you mind keeping C++ version here?
P.S.: thanks for resurrecting this change, I completely forgot about it.
There was a problem hiding this comment.
BTW, Main concern here is to avoid changing of unrelated code (printf() statement).
These lines should do the same things:
fflush(stdout);
std::cout.flush();
std::cout << std::flush;
fflush(stdout); has been selected because it correlates with printf() (both are C-style).
There was a problem hiding this comment.
I've reverted the change and use fflush as you suggested.
…s so that user is informed of updates quickly.
d0ba872 to
418eb36
Compare
…-samples-number * Add flushing to printing number of processed positive/negative samples so that user is informed of updates quickly. * use flush C api instead of C++ api
This pullrequest changes
Add flushing to printing number of processed positive/negative samples so that when running opencv_traincascade, the user is informed of updates quicker.
Without this change I got updates one per half of hour.