Golang Vehicle Detector Example

Initialize vehicle detector model

import ("oneml/face")
detector := face.NewVehicleDetector()

Initialize vehicle detector model with licensing

import ("oneml/face")
licenseManager := face.NewLicenseManager()
licenseManager.SetKey("LICENSE_KEY_VALUE_HERE")
licenseManager.ActivateKey()
detector := new VehicleDetector(licenseManager)

Initialize oneML’s Utils

utils := face.NewUtils()

Initialize oneML’s Utils with licensing

utils := face.NewUtils(licenseManager)

Read input as oneML’s Image

img := utils.ReadImageCV(filePath)

Run the model

results := detector.Detect(batch)

or

result := detector.Detect(img)

And get the output

scores := result.GetScores()
bboxes := result.GetBBoxes()
size := result.GetSize()
statuses := result.GetReturnStatus()

Cleanup

defer face.DeleteVehicleDetector(detector)
defer face.DeleteUtils(utils)