bb_estimator_object_detection
A Beam Bots estimator that finds objects
in camera frames with any object-detection model declared through
bb_inference.
inference do
model :detector do
runtime BB.Inference.TFLite
source "https://storage.googleapis.com/download.tensorflow.org/models/tflite/coco_ssd_mobilenet_v1_1.0_quant_2018_06_29.zip"
archive_member "detect.tflite"
sha256 "e4b118e5e4531945de2e659742c7c590f7536f8d0ed26d135abcfe83b4779d13"
codec {BB.Estimator.ObjectDetection.FinalDetections, mean: 127.5, std: 127.5}
end
end
topology do
link :head do
sensor :camera, {BB.Camera.V4L, device: "/dev/video0"} do
estimator :objects, {BB.Estimator.ObjectDetection, model: :detector}
end
end
end
The estimator names only the model. For every frame it examines it publishes
a BB.Message.Vision.Detections at its own path - labelled boxes in frame
pixels, highest score first, stamped with the frame's capture time - which
bb_liveview draws over the
camera's preview.
What's in it
BB.Estimator.ObjectDetection- the estimator: runs the model's codec, suppresses overlapping boxes when the codec says it should, applies labels, publishes.- The
:object_detectiontask (BB.Estimator.ObjectDetection.Codec) - what a detection codec takes and gives. BB.Estimator.ObjectDetection.Image- the one image-preparation path every image codec uses: I420 to RGB or BGR, stretch or letterbox, per-channel normalisation, and quantisation, all in OpenCV.BB.Estimator.ObjectDetection.FinalDetections- a codec for any model that does its own decode and suppression, such as TFLite's SSD post-processing.BB.Message.Vision.Detections- the message, and its camera overlay.
Codecs for particular model families live in their own packages, such as
bb_estimator_yolo.
Options
| Option | Default | |
|---|---|---|
model |
required | An object-detection model declared in inference |
score_threshold |
0.3 |
Minimum score to publish |
nms_threshold |
0.45 |
IoU above which the lower-scoring of two boxes is dropped, whatever their classes |
Installation
mix igniter.install bb_estimator_object_detection