Open bertsky opened 3 years ago
Spoiler: I know how to do this. Would you care for a PR?
Spoiler: I know how to do this. Would you care for a PR?
@bertsky I appreciate it if you do that :)
@bertsky did you ever complete this improvement? Maybe on a fork? I would like to run this binarization on a large dataset and with the current procedure it is simply too slow (10-20 images per minute).
When the model is applied in patch mode (the default), a loop over the windows is run (on CPU / in Numpy) and passed to
model.predict()
as a single image each (on GPU / in Keras).https://github.com/qurator-spk/sbb_binarization/blob/8dd05064b2dbdc7d4bdfb8896251302e8ec5ecb3/sbb_binarize/sbb_binarize.py#L152
This does not utilize the GPU for two reasons:
I suggest changing the following:
keras.utils.Sequence
.predict_generator
instead ofpredict
to get concurrent CPU / GPU computation.