I’m uunable to make work the smart nvr example 
It throws the next execption:
[[0, 0], [1920, 0], [1920, 1080], [0, 1080]]
Traceback (most recent call last):
File "/root/api_ai_inference/stream_service.py", line 116, in <module>
dgstreams.Composition(cam_source >> detector >> streamer).start()
File "/usr/local/lib/python3.10/dist-packages/degirum_tools/streams/base.py", line 695, in start
self.wait()
File "/usr/local/lib/python3.10/dist-packages/degirum_tools/streams/base.py", line 771, in wait
raise Exception(errors)
Exception: Error detected during execution of AiSimpleGizmo:
<class 'degirum.exceptions.DegirumException'>: Failed to perform model 'yolo11s_coco--640x640_quant_hailort_hailo8_1' inference: OpenCV(4.11.0) /io/opencv/modules/imgproc/src/drawing.cpp:2426: error: (-215:Assertion failed) p.checkVector(2, CV_32S) > 0 in function 'fillPoly'
degirum.exceptions.DegirumException: OpenCV(4.11.0) /io/opencv/modules/imgproc/src/drawing.cpp:2426: error: (-215:Assertion failed) p.checkVector(2, CV_32S) > 0 in function 'fillPoly'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/degirum_tools/streams/base.py", line 662, in gizmo_run
gizmo.run()
File "/usr/local/lib/python3.10/dist-packages/degirum_tools/streams/gizmos.py", line 689, in run
for result in self.model.predict_batch(source()):
File "/usr/local/lib/python3.10/dist-packages/degirum/model.py", line 293, in predict_batch
for res in self._predict_impl(source):
File "/usr/local/lib/python3.10/dist-packages/degirum/model.py", line 1233, in _predict_impl
raise DegirumException(msg) from saved_exception
degirum.exceptions.DegirumException: Failed to perform model 'yolo11s_coco--640x640_quant_hailort_hailo8_1' inference: OpenCV(4.11.0) /io/opencv/modules/imgproc/src/drawing.cpp:2426: error: (-215:Assertion failed) p.checkVector(2, CV_32S) > 0 in function 'fillPoly'
If I remove the notitifer, detector and counter the error dissapear.
I also tried with all the yolo models I was able to find, and every one gives the same error, with the oonly difference being the model name of course
This is how the code looks:
hw_location="10.0.0.2:8778"
#model_name = "yolo11n_visdrone_person--640x640_quant_hailort_multidevice_1"
#model_name = "yolo11n_coco--640x640_quant_hailort_hailo8_1"
model_name = "yolo11s_coco--640x640_quant_hailort_hailo8_1"
#model_name = "yolov8s_coco--320x320_quant_hailort_hailo8_1"
#model_name = "yolov8n_coco--640x640_quant_hailort_hailo8_1"
#model_name = "yolov8m_coco--640x640_quant_hailort_hailo8_1"
#model_name = "yolov8s_coco--640x640_quant_hailort_hailo8_1"
#model_name = "yolov5s_coco--640x640_quant_hailort_multidevice_1"
#model_name = "yolov5n_relu6_coco--640x640_quant_hailort_hailo8_1"
#model_name = "yolov5s_relu6_coco--640x640_quant_hailort_hailo8_1"
model_zoo_url="aiserver://home/pi/DeGirum/zoo"
video_source = args.input
video_output= args.output
classes = {"clock"}
device_type = "HAILORT/HAILO8"
model_manager = dg.connect(
inference_host_address=hw_location,
zoo_url = model_zoo_url
)
model = model_manager.load_model(
model_name=model_name,
device_type=device_type,
#output_confidence_threshold=0.3,
input_pad_method="letterbox",
image_backend='opencv',
overlay_color=[255,0,0],
output_class_set=classes
)
anchor = degirum_tools.AnchorPoint.CENTER
# create object tracker
tracker = degirum_tools.ObjectTracker(
class_list=classes,
track_thresh=0.35,
track_buffer=100,
match_thresh=0.9999,
trail_depth=20,
anchor_point=anchor,
show_only_track_ids = True,
#show_overlay = True,
annotation_color = [255,0,0]
)
cam_source = dgstreams.VideoSourceGizmo(video_source)
width=cam_source.get_video_properties()[0]
height=cam_source.get_video_properties()[1]
zones=[[0,0],[width,0],[width,height],[0,height]]
print(zones)
#
# create analyzers:
#
event_name = "object_detected"
zone_counter = degirum_tools.ZoneCounter(
zones,
use_tracking=True,
triggering_position=[anchor],
annotation_color=(0, 255, 0),
)
zone_detector = degirum_tools.EventDetector(
f"""
Trigger: {event_name}
when: ZoneCount
is greater than: 0
during: [10, frames]
for at least: [90, percent]
""",
show_overlay=False,
)
holdoff_sec = 3.0
notification_config = "notifyconf.txt" # file with apprise url
# event notifier
notifier = degirum_tools.EventNotifier(
event_name,
event_name,
message="{time}: person is detected in zone",
holdoff=holdoff_sec,
notification_config=notification_config,
clip_save=False,
)
degirum_tools.attach_analyzers(model, [tracker, zone_counter, zone_detector, notifier])
#degirum_tools.attach_analyzers(model, [tracker])
detector = dgstreams.AiSimpleGizmo(model)
streamer = dgstreams.VideoStreamerGizmo(video_output, show_ai_overlay=True)
dgstreams.Composition(cam_source >> detector >> streamer).start()