robertknight / ocrs

Rust library and CLI tool for OCR (extracting text from images)
Apache License 2.0
1.09k stars 44 forks source link

Avoid unnecessary copies when preparing detection inputs #57

Closed robertknight closed 4 months ago

robertknight commented 4 months ago

Remove a copy that is sometimes redundant:

For small inputs where both spatial dimensions are smaller than the model's input we'll need to pad but not resize. For large inputs where the opposite is true we'll need to resize but not pad. For medium inputs where one dim exceeds the corresponding model input size and the other is smaller, we'll need to do both.