80-Class Object Detection ========================= Python Example -------------- .. literalinclude:: /_static/products/aicamera-k230d/_static/python-examples/object_detection_80.py :caption: Example: 80-Class Object Detection.py :name: 80-Class Object Detection.py mPython Graphical Example ------------------------- .. figure:: /_static/products/aicamera-k230d/_static/image/example/object_detection_80.png :align: center :width: 1080 Functions and Methods --------------------- .. function:: smart_camera.model_init(cur_state) :noindex: Instantiate the model :param cur_state: model id for initialization :type cur_state: int Example:: smart_camera.model_init(2) .. class:: smart_camera.yolo_detect .. method:: recognize() :noindex: Run recognition .. class:: smart_camera.yolo_detect 80-class instance :var int id: 80-class category id, range: 0-79 :var list category_list: list of the 80 object categories, ["人","自行车","汽车","摩托车","飞机","公共汽车","火车","卡车","船","交通灯","消防栓","停车标志","泊车计时器","长椅","鸟","猫","狗","马","绵羊","奶牛","大象","熊","斑马","长颈鹿","背包","雨伞","手提包","领带","手提箱","飞盘","滑雪板","运动球","风筝","棒球","蝙蝠","棒球手套","滑板","冲浪板","网球拍","瓶子","酒杯","杯子","叉子","刀","勺子","碗","香蕉","苹果","三明治","橙子","西兰花","胡萝卜","热狗","披萨","甜甜圈","蛋糕","椅子","沙发","盆栽","床","餐桌","厕所","电视","笔记本电脑","鼠标","遥控器","键盘","手机","微波炉","烤箱","烤面包机", "水槽","冰箱","书籍","时钟","花瓶","剪刀","泰迪熊","吹风机","牙刷"] :var float max_score: confidence, range: 0-100 .. note:: The ``category_list`` attribute returns **Chinese strings** — these are the original labels produced by the K230D firmware's built-in YOLO model (COCO 80-class). When comparing detection results in your code, you must use these exact Chinese strings; translating them will cause mismatches at runtime. Example usage:: # category_list[idx] returns a Chinese label such as '人' (person); # always compare against the exact string from the library if smart_camera.yolo_detect.category_list[smart_camera.yolo_detect.id] == '人': print("Person detected!")