Methods
Note: Examples in this guide assume you have already configured LicensePlateRecognizerConfig with model specifications. See Configuration Guide for complete setup details.
Methods Overview
predict()
Recognize plates in one image
One image
Single photo processing
predict_batch()
Recognize plates in multiple images
Image iterator
Video/batch processing
Performance tip: Use predict_batch() for multiple items - it provides ~2-3x speedup through pipeline parallelism.
InferenceResults
predict() and predict_batch() return DeGirum InferenceResults objects with a .license_plates property containing detected plates.
Key property: .license_plates - List of LPRResult objects, each with plate_number (text), ocr_score (OCR confidence), detection_score (detection confidence), bbox (bounding box)
See InferenceResults documentation for standard PySDK methods like image_overlay(), results, etc.
predict()
Recognize license plates in a single image.
Signature
predict(frame: Any) -> degirum.postprocessor.InferenceResultsParameters
frame- Image as numpy array or file path (str)
Returns
degirum.postprocessor.InferenceResults- Object with.license_platesproperty containing list of detected plates. See InferenceResults documentation
How It Works
Detects all license plates in the image
Crops each detected plate region
Runs OCR on each cropped plate
Returns results with recognized text in
labelfield
Examples
Recognize from file path:
Recognize from numpy array:
Using demo image:
Best Practices
Use clear images - Better lighting and focus improve OCR accuracy
Frame the plate - Closer views of plates work better
Check confidence scores - Filter results by
plate.ocr_scorethreshold
predict_batch()
Recognize license plates in multiple images efficiently.
Signature
Parameters
frames- Iterator yielding frames as numpy arrays or file paths
Returns
Iterator yielding
degirum.postprocessor.InferenceResultsobjects with.license_platesproperty
How It Works
Processes all images through detection → cropping → OCR pipeline
Pipeline parallelism makes this faster than calling
predict()repeatedlyYields results as they're processed
Examples
Process multiple images:
Process video frames:
Filter by confidence:
Best Practices
Use iterators - Pass iterators (not lists) for memory efficiency
Pipeline parallelism -
predict_batch()is 2-3x faster than multiplepredict()callsProcess video frames - Ideal for frame-by-frame video analysis
Filter results - Apply confidence thresholds to get high-quality detections
Complete Example
Last updated
Was this helpful?

