TShopping

 找回密碼
 註冊
搜索
查看: 1847|回復: 0

[教學] WIN10 + OpenVINO C++範例編譯及下載(測試成功)

[複製鏈接]
發表於 2021-11-4 15:22:15 | 顯示全部樓層 |閱讀模式
 
Push to Facebook

參考應用範例


到此目錄下

  1. C:\Program Files (x86)\Intel\openvino_2021.4.689\deployment_tools\open_model_zoo\demos
複製代碼

一鍵編譯build所有的C++ 範例使用VS Build

執行:

  1. build_demos_msvc.bat
複製代碼



WIN10,OpenVINO,範例編譯,下載

WIN10,OpenVINO,範例編譯,下載



順利Build完後的執行檔位置 加入環境變數

  1. C:\Users\User name\Documents\Intel\OpenVINO\omz_demos_build\intel64\Release
複製代碼
  1. C:\Users\Administrator\Documents\Intel\OpenVINO\omz_demos_build\intel64\Release
複製代碼

WIN10,OpenVINO,範例編譯,下載

WIN10,OpenVINO,範例編譯,下載


接著就可以來下載模型來玩玩看了

首先到此目錄下尋找想要的模型並下載 也可加入環境變數

  1. C:\Program Files (x86)\Intel\openvino_2021.4.689\deployment_tools\open_model_zoo\tools\downloader
複製代碼

執行

  1. python downloader.py  --all
複製代碼

就能看到目前intel提供已轉好的AI模型檔(每次改版都會不定期增加)


如果要下載特定XML,BIN

  1. python downloader.py  --name text-detection-0004 --precisions FP16
複製代碼

他就會下載到下列路徑目錄下

  1. C:\Program Files (x86)\Intel\openvino_2021.4.689\deployment_tools\open_model_zoo\tools\downloader\intel
複製代碼

WIN10,OpenVINO,範例編譯,下載

WIN10,OpenVINO,範例編譯,下載




以人臉偵測範例為例

所有XML與BIN位置

所需要的AI model 包含

face-detection-adas-0001
age-gender-recognition-retail-0013
head-pose-estimation-adas-0001
emotions-recognition-retail-0003
facial-landmarks-35-adas-0002

下載後的AI模型,模型會包含FP32 和 FP16,部分會有INT8模型

也就是針對硬體效能與精準度做取捨,可以選擇載入全精度、半精度、量化模型

路徑:

  1. C:\Program Files (x86)\Intel\openvino_2021.4.689\deployment_tools\open_model_zoo\tools\downloader\intel\face-detection-adas-0001
複製代碼


WIN10,OpenVINO,範例編譯,下載

WIN10,OpenVINO,範例編譯,下載

WIN10,OpenVINO,範例編譯,下載

WIN10,OpenVINO,範例編譯,下載



跑起來~藉著我們就可以掛載AI模型來驗證囉

在執行下面指令前需要建置環境

請先執行 Conda 虛擬機 OpenVino + win10 完整安裝(測試成功) 的環境

  1. "C:\Program Files (x86)\Intel\openvino_2021\bin\setupvars.bat"
複製代碼
  1. interactive_face_detection_demo.exe -i cam(鏡頭編號 0) -m C:\Program Files (x86)\Intel\openvino_2021.4.689\deployment_tools\open_model_zoo\tools\downloader\intel\face-detection-adas-0001\FP32\face-detection-adas-0001.xml
複製代碼

WIN10,OpenVINO,範例編譯,下載

WIN10,OpenVINO,範例編譯,下載

WIN10,OpenVINO,範例編譯,下載

WIN10,OpenVINO,範例編譯,下載

  1. interactive_face_detection_demo.exe -i cam -m face-detection-adas-0001\FP32\face-detection-adas-0001.xml -m_ag age-gender-recognition-retail-0013\FP32\age-gender-recognition-retail-0013.xml -m_em emotions-recognition-retail-0003\FP32\emotions-recognition-retail-0003.xml -m_lm facial-landmarks-35-adas-0002\FP32\facial-landmarks-35-adas-0002.xml
複製代碼


WIN10,OpenVINO,範例編譯,下載

WIN10,OpenVINO,範例編譯,下載


  1. interactive_face_detection_demo.exe -i cam -m face-detection-adas-0001\FP32\face-detection-adas-0001.xml -m_ag age-gender-recognition-retail-0013\FP32\age-gender-recognition-retail-0013.xml -m_em emotions-recognition-retail-0003\FP32\emotions-recognition-retail-0003.xml -m_hp head-pose-estimation-adas-0001\FP32\head-pose-estimation-adas-0001.xml -m_lm facial-landmarks-35-adas-0002\FP32\facial-landmarks-35-adas-0002.xml
複製代碼

WIN10,OpenVINO,範例編譯,下載

WIN10,OpenVINO,範例編譯,下載

在 python 下 直接下指令
  1. import os
  2. os.system("start interactive_face_detection_demo.exe -i 0 -m face-detection-adas-0001/FP32/face-detection-adas-0001.xml")

  3. os.system("start interactive_face_detection_demo.exe -i 0 -m face-detection-adas-0001/FP32/face-detection-adas-0001.xml -m_ag age-gender-recognition-retail-0013/FP32/age-gender-recognition-retail-0013.xml -m_em emotions-recognition-retail-0003/FP32/emotions-recognition-retail-0003.xml -m_hp head-pose-estimation-adas-0001/FP32/head-pose-estimation-adas-0001.xml -m_lm facial-landmarks-35-adas-0002/FP32/facial-landmarks-35-adas-0002.xml")
複製代碼


參考文章




 

臉書網友討論
*滑块验证:
您需要登錄後才可以回帖 登錄 | 註冊 |

本版積分規則



Archiver|手機版|小黑屋|免責聲明|TShopping

GMT+8, 2024-3-29 14:12 , Processed in 0.063173 second(s), 26 queries .

本論壇言論純屬發表者個人意見,與 TShopping綜合論壇 立場無關 如有意見侵犯了您的權益 請寫信聯絡我們。

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回復 返回頂部 返回列表