




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

# 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
運行結果,如下圖所示:
-
開發板
+關注
關注
25文章
5121瀏覽量
98187 -
模型
+關注
關注
1文章
3305瀏覽量
49217 -
目標檢測
+關注
關注
0文章
211瀏覽量
15664
原文標題:?在AI愛克斯開發板上用OpenVINO加速YOLOv8-seg實例分割模型
文章出處:【微信號:SDNLAB,微信公眾號:SDNLAB】歡迎添加關注!文章轉載請注明出處。
發布評論請先 登錄
相關推薦
在C++中使用OpenVINO工具包部署YOLOv5-Seg模型

【愛芯派 Pro 開發板試用體驗】yolov8模型轉換
在英特爾獨立顯卡上部署YOLOv5 v7.0版實時實例分割模型
在C++中使用OpenVINO工具包部署YOLOv5模型
自訓練Pytorch模型使用OpenVINO?優化并部署在AI愛克斯開發板

在英特爾開發者套件上用OpenVINO? 2023.0加速YOLOv8-Pose姿態估計模型

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

基于OpenVINO在英特爾開發套件上實現眼部追蹤
基于哪吒開發板部署YOLOv8模型

評論