




-
輸入節(jié)點名字:“images”;數(shù)據(jù):float32[1,3,640,640]。
-
輸出節(jié)點1的名字:“output0”;數(shù)據(jù):float32[1,116,8400]。其中116的前84個字段跟 YOLOv8目標(biāo)檢測模型輸出定義完全一致,即cx,cy,w,h和80類的分?jǐn)?shù);后32個字段用于計算掩膜數(shù)據(jù)。
-
輸出節(jié)點2的名字:“output1”;數(shù)據(jù):float32[1,32,160,160]。output0后32個字段與output1的數(shù)據(jù)做矩陣乘法后得到的結(jié)果,即為對應(yīng)目標(biāo)的掩膜數(shù)據(jù)。

# Initialize the VideoCapture
cap =cv2.VideoCapture("store-aisle-detection.mp4")
# Initialize YOLOv5 Instance Segmentator
model_path ="yolov8n-seg.xml"
device_name ="GPU"
yoloseg =YOLOSeg(model_path, device_name, conf_thres=0.3, iou_thres=0.3)
whilecap.isOpened():
# Read frame from the video
ret, frame =cap.read()
ifnotret:
break
# Update object localizer
start =time.time()
boxes, scores, class_ids, masks =yoloseg(frame)
# postprocess and draw masks
combined_img =yoloseg.draw_masks(frame)
end =time.time()
# show FPS
fps =(1/(end -start))
fps_label ="Throughput: %.2fFPS"%fps
cv2.putText(combined_img, fps_label, (10, 25), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 0, 255), 2)
# show ALL
cv2.imshow("YOLOv8 Segmentation OpenVINO inference Demo", combined_img)
# Press Any key stop
ifcv2.waitKey(1) >-1:
print("finished by user")
break
運行結(jié)果,如下圖所示:
-
開發(fā)板
+關(guān)注
關(guān)注
25文章
5622瀏覽量
103597 -
模型
+關(guān)注
關(guān)注
1文章
3504瀏覽量
50203 -
目標(biāo)檢測
+關(guān)注
關(guān)注
0文章
223瀏覽量
15958
原文標(biāo)題:?在AI愛克斯開發(fā)板上用OpenVINO加速YOLOv8-seg實例分割模型
文章出處:【微信號:SDNLAB,微信公眾號:SDNLAB】歡迎添加關(guān)注!文章轉(zhuǎn)載請注明出處。
發(fā)布評論請先 登錄
在C++中使用OpenVINO工具包部署YOLOv5-Seg模型

【愛芯派 Pro 開發(fā)板試用體驗】yolov8模型轉(zhuǎn)換
在英特爾獨立顯卡上部署YOLOv5 v7.0版實時實例分割模型
TensorRT 8.6 C++開發(fā)環(huán)境配置與YOLOv8實例分割推理演示

自訓(xùn)練Pytorch模型使用OpenVINO?優(yōu)化并部署在AI愛克斯開發(fā)板

在英特爾開發(fā)者套件上用OpenVINO? 2023.0加速YOLOv8-Pose姿態(tài)估計模型

用OpenVINO? C++ API編寫YOLOv8-Seg實例分割模型推理程序

基于OpenVINO在英特爾開發(fā)套件上實現(xiàn)眼部追蹤
基于哪吒開發(fā)板部署YOLOv8模型

評論