// Synthetic supplied detector rows; no pretrained detector is executed.
import aner.video
import aner.vision
import aner.tensor

let source = video.synthetic(width: 64, height: 32, frames: 1)
let frame = video.frame_slot()
let plan = vision.preprocess(width: 64, height: 64)
let input = vision.input_slot(plan)
let objects = vision.detections(max_detections: 10)
let detector_rows: Tensor = [
    [8.0, 20.0, 40.0, 44.0, 0.9, 0.0],
    [9.0, 21.0, 39.0, 43.0, 0.8, 0.0],
    [8.0, 20.0, 40.0, 44.0, 0.7, 1.0]]
if source.read_into(frame) == "ready" {
    plan.prepare_into(frame, input)
    vision.postprocess_into(detector_rows, input, objects)
    print(objects.count())
    print(objects.class_id(0))
    print(objects.y1(0))
    print(objects.source_id())
}
source.close()
