<p align="center">
<img src="https://github.com/felixdittrich92/OnnxTR/blob/main/docs/images/logo.jpg" width="50%">
</p>
What's Changed
- Sync with current docTR state
- Added advanced options to configure the underlying execution engine
- Added new `db_mobilenet_v3_large` converted models (fp32 & 8bit)
Advanced engine configuration
python
from onnxruntime import SessionOptions
from onnxtr.models import ocr_predictor, EngineConfig
general_options = SessionOptions() For configuartion options see: https://onnxruntime.ai/docs/api/python/api_summary.html#sessionoptions
general_options.enable_cpu_mem_arena = False
NOTE: The following would force to run only on the GPU if no GPU is available it will raise an error
List of strings e.g. ["CUDAExecutionProvider", "CPUExecutionProvider"] or a list of tuples with the provider and its options e.g.
[("CUDAExecutionProvider", {"device_id": 0}), ("CPUExecutionProvider", {"arena_extend_strategy": "kSameAsRequested"})]
providers = [("CUDAExecutionProvider", {"device_id": 0})] For available providers see: https://onnxruntime.ai/docs/execution-providers/
engine_config = EngineConfig(
session_options=general_options,
providers=providers
)
We use the default predictor with the custom engine configuration
NOTE: You can define different engine configurations for detection, recognition and classification depending on your needs
predictor = ocr_predictor(
det_engine_cfg=engine_config,
reco_engine_cfg=engine_config,
clf_engine_cfg=engine_config
)
**Full Changelog**: https://github.com/felixdittrich92/OnnxTR/compare/v0.2.0...v0.3.0