Python Vehicle Detector ExampleΒΆ
Initialize vehicle detector model
from oneML import alprAPI as api
detector = api.VehicleDetector()
Initialize vehicle detector model with licensing
from oneML import alprAPI as api
license_manager = api.LicenseManager()
license_manager.set_key("LICENSE_KEY_VALUE_HERE")
license_manager.activate_key()
detector = api.VehicleDetector(license_manager)
Read input as numpy array
img = np.array(cv2.cvtColor(cv2.imread(image_path), cv2.COLOR_BGR2RGB), dtype=np.uint8)
imgs = np.expand_dims(img, axis=0)
Run the model
results = detector.detect(imgs)
or
result = detector.detect(img)
And get the output
scores = result.get_scores()
bboxes = result.get_bboxes()
size = result.get_size()
statuses = result.get_return_status()