【翻譯】OpenVINO Pre-Trained 預訓練模型介紹
OpenVINO 系列軟體包預訓練模型介紹
本文翻譯自 Intel OpenVINO 的 "Overview of OpenVINO Toolkit Pre-Trained Models"
原文連結: https://docs.openvinotoolkit.org/latest/_models_intel_index.html
翻譯:coneypo,working in Intel for IoT,有問題或者建議歡迎留言交流
Q&A
問:用 Pre-trained model 可以幹什麼?
答:我們可以用 Pre-trained 的模型直接輸入資料進行 model inference / 推理,而不需要收集資料集自己 Train 一個 model,這些訓練好的模型拿來即用,適合新手學習;
問:如何使用 OpenVINO 預訓練模型進行推算?
答:
1. 先下載安裝 OpenVINO 環境: https://docs.openvinotoolkit.org/cn/index.html;
2. OpenVINO 提供的 model zoo 的示例程式碼在這個 repo :
$ git clone https://github.com/opencv/open_model_zoo
$ cd /open_model_zoo/demos/python_demos/
3. 比如有一個 face_recognition_demo/ 資料夾,裡面有個 README.md 告訴怎麼配置引數:
python ./face_recognition_demo.py ^
-m_fd <path_to_model>/face-detection-retail-0004.xml ^
-m_lm <path_to_model>/landmarks-regression-retail-0009.xml ^
-m_reid <path_to_model>/face-reidentification-retail-0095.xml ^
--verbose ^
-fg "C:/face_gallery"4. 下載模型
$ cd /<OPENVINO_INSTALL_DIR>/deployment_tools/open_model_zoo/tools/downloader/
$ sudo ./downloader.py --name face-detection-retail-0004
$ sudo ./downloader.py --name landmarks-regression-retail-0009.xml
$ sudo ./downloader.py --name face-reidentification-retail-0095.xml
5. 執行 face_recognition_demo.py
這篇文章中會介紹如下模型:
- Object Detection Models / 目標檢測模型
- Object Recognition Models / 目標識別模型
- Reidentification Models / 迴歸模型
- Semantic Segmentation Models / 語義分割模型
- Instance Segmentation Models / 例項分割模型
- Human Pose Estimation Models / 人類姿勢識別模型
- Image Processing/ 影象處理
- Text Detection / 文字檢測
- Text Recognition / 文字識別
- Text Spotting / 文字識別
- Action Recognition Models / 動作識別模型
- Image Retrieval / 影象檢索
- Compressed models / 壓縮模型
OpenVINO 軟體包提供一系列預訓練模型,你可以用來進行學習,或者進行參考設計;
OpenVINO 的版本會在 Github_open_model zoo 上面進行維護;
這些模型也可以通過模型下載器 (<OPENVINO_INSTALL_DIR>/deployment_tools/open_model_zoo/tools/downloader) 下載,或者在 01.org 進行手動下載;
*(補充)Classification / 分類,Detection / 檢測,Semantic Segmentation / 語義分割,Instance Segmentation / 例項分割 區別
Object Detection Models / 目標檢測模型
OpenVINO 提供一系列熱門目標,如人臉/人/汽車等等的檢測模型;大多數網路都是基於 SSD (Single Shot MultiBox Detector),而且準確度和效能都不錯;
針對於檢測相同型別目標的網路(比如 face-detection-adas-0001 和 face-detection-retail-0004),能夠以較小的效能代價,讓我們達到更高的精度和更廣的適用範圍;
因此你可以期待一個更大的神經網路,來更好的檢測相同型別的物件;
模型名稱 | 複雜度 (GFLOPS) | 大小(MP) | 人臉 | 人 | 汽車 | 自行車 | 車牌 | 產品 |
---|---|---|---|---|---|---|---|---|
faster-rcnn-resnet101-coco-sparse-60-0001 | 364.21 | 52.79 | X | X | X | |||
face-detection-adas-0001 | 2.835 | 1.053 | X | |||||
face-detection-adas-binary-0001 | 0.819 | 1.053 | X | |||||
face-detection-retail-0004 | 1.067 | 0.588 | X | |||||
face-detection-retail-0005 | 0.982 | 1.021 | X | |||||
face-detection-0100 | 0.785 | 1.828 | X | |||||
face-detection-0102 | 1.767 | 1.842 | X | |||||
face-detection-0104 | 2.405 | 1.851 | X | |||||
face-detection-0105 | 2.853 | 2.392 | X | |||||
face-detection-0106 | 339.597 | 69.920 | X | |||||
person-detection-retail-0002 | 12.427 | 3.244 | X | |||||
person-detection-retail-0013 | 2.300 | 0.723 | X | |||||
person-detection-action-recognition-0005 | 7.140 | 1.951 | X | |||||
person-detection-action-recognition-0006 | 8.225 | 2.001 | X | |||||
person-detection-action-recognition-teacher-0002 | 7.140 | 1.951 | X | |||||
person-detection-raisinghand-recognition-0001 | 7.138 | 1.951 | X | |||||
pedestrian-detection-adas-0002 | 2.836 | 1.165 | X | |||||
pedestrian-detection-adas-binary-0001 | 0.945 | 1.165 | X | |||||
pedestrian-and-vehicle-detector-adas-0001 | 3.974 | 1.650 | X | X | ||||
vehicle-detection-adas-0002 | 2.798 | 1.079 | X | |||||
vehicle-detection-adas-binary-0001 | 0.942 | 1.079 | X | |||||
person-vehicle-bike-detection-crossroad-0078 | 3.964 | 1.178 | X | X | X | |||
person-vehicle-bike-detection-crossroad-1016 | 3.560 | 2.887 | X | X | X | |||
vehicle-license-plate-detection-barrier-0106 | 0.349 | 0.634 | X | X | ||||
product-detection-0001 | 3.598 | 3.212 | X | |||||
person-detection-asl-0001 | 0.986 | 1.338 | X | |||||
yolo-v2-ava-0001 | 29.38 | 48.29 | X | X | X | |||
yolo-v2-ava-sparse-35-0001 | 29.38 | 48.29 | X | X | X | |||
yolo-v2-ava-sparse-70-0001 | 29.38 | 48.29 | X | X | X | |||
yolo-v2-tiny-ava-0001 | 6.975 | 15.12 | X | X | X | |||
yolo-v2-tiny-ava-sparse-30-0001 | 6.975 | 15.12 | X | X | X | |||
yolo-v2-tiny-ava-sparse-60-0001 | 6.975 | 15.12 | X | X | X |
Object Recognition Models / 目標識別模型
目標識別模型用來進行 Classification / 分類,Regression / 迴歸,Charcter recognition / 特徵識別;
針對某種特徵進行檢測之後,再使用這些神經網路進行檢測/識別(比如在人臉識別之後,再進行年齡/性別的識別);
模型名稱 | 複雜度 (GFLOPS) | 大小 (MP) |
---|---|---|
age-gender-recognition-retail-0013 | 0.094 | 2.138 |
head-pose-estimation-adas-0001 | 0.105 | 1.911 |
license-plate-recognition-barrier-0001 | 0.328 | 1.218 |
vehicle-attributes-recognition-barrier-0039 | 0.126 | 0.626 |
emotions-recognition-retail-0003 | 0.126 | 2.483 |
landmarks-regression-retail-0009 | 0.021 | 0.191 |
facial-landmarks-35-adas-0002 | 0.042 | 4.595 |
person-attributes-recognition-crossroad-0230 | 0.174 | 0.735 |
gaze-estimation-adas-0002 | 0.139 | 1.882 |
Reidentification Models / 再識別模型
在視訊中,進行精準的目標追蹤是計算機視覺的典型應用場景;
它通常會因為一系列的事情而變得相對比較複雜,這些事情可以描述為 "Relatively long absence of an object" / 一個物件相對較長的缺失;
比如,可能由於 occlusion / 遮擋 或者 out-of-frame movement / 框外移動 導致的;
針對這種情況,最好將目標視為 "seen before" / 先前見過的,而不管其在影象中的當前位置,或者距離上次識別出位置經過多長時間;
下面的網路用在以上這種情況,這些網路獲取一個人的影象,然後將這個人的特徵在高維空間中進行評估;這些特徵向量會進行進一步評估:通過比較歐式距離來確定是否是同一個人;
這裡提供了幾種模型,在效能和精確度之間進行權衡(模型更大,效能更好):
模型名稱 | 複雜度 (GFLOPS) | 大小 (MP) | RANK-1 ON MARKET-1501 資料集 |
---|---|---|---|
person-reidentification-retail-0031 | 0.028 | 0.280 | 92.11% |
person-reidentification-retail-0248 | 0.174 | 0.183 | 84.3% |
person-reidentification-retail-0249 | 0.564 | 0.597 | 92.9% |
person-reidentification-retail-0300 | 3.521 | 5.289 | 96.3% |
模型名稱 | 複雜度 (GFLOPS) | 大小 (MP) | RANK-1 ON MARKET-1501 資料集 |
---|---|---|---|
face-reidentification-retail-0095 | 0.588 | 1.107 | 99.33% |
Semantic Segmentation Models / 語義分割模型
語義分割可以歸為目標檢測的拓展問題;
返回的不是特徵框,語義分割模型返回輸入影象(影象中每個畫素的顏色代表著特定的類別)的 Painted version / 塗色塊;
這些網路比目標檢測網路要複雜的多,但是提供了一個畫素級別的分類,屬於同一類的畫素會被歸為一類(塗上相同顏色),而且可以檢測到複雜圖形中的空間(比如道路中的可用區域);
模型名稱 | 複雜度(GFLOPS) | 大小 (MP) |
---|---|---|
road-segmentation-adas-0001 | 4.770 | 0.184 |
semantic-segmentation-adas-0001 | 58.572 | 6.686 |
unet-camvid-onnx-0001 | 260.1 | 31.03 |
icnet-camvid-ava-0001 | 151.82 | 25.45 |
icnet-camvid-ava-sparse-30-0001 | 151.82 | 25.45 |
icnet-camvid-ava-sparse-60-0001 | 151.82 | 25.45 |
Instance Segmentation Models / 例項分割模型
例項分割模型是目標檢測和語義分割的拓展;
例項分割模型不是對每個目標例項進行特徵框預測分析,而是為每個例項生成畫素級別的遮罩;
模型名稱 | 複雜度 (GFLOPS) | 大小 (MP) |
---|---|---|
instance-segmentation-security-1025 | 30.146 | 26.69 |
instance-segmentation-security-0050 | 46.602 | 30.448 |
instance-segmentation-security-0083 | 365.626 | 143.444 |
instance-segmentation-security-0010 | 899.568 | 174.568 |
Human Pose Estimation Models / 人類姿勢估計模型
人體姿勢估計任務用來預測姿勢:對於輸入的影象或者視訊,推斷出帶有特徵點和特徵點之間連線的身體骨骼;特徵點是身體器官:比如耳朵,眼睛,鼻子,胳膊,膝蓋等等;
有兩種主要的分類:top-down / 從上往下, bottom-up / 從下往上;
第一種方法在給定的幀中,檢測出人,然後裁剪和調整,執行姿勢估計網路為每個檢測出來的人,這種方法很精確;
第二種找到給定的幀中,所有的特徵點,然後根據人的例項進行分類,因此比第一種更快,因為網路只運行了一次;
模型名稱 | 複雜度 (GFLOPS) | 大小 (MP) |
---|---|---|
human-pose-estimation-0001 | 15.435 | 4.099 |
Image Processing / 影象處理
深度學習模型在影象處理中應用來提高輸出質量:
模型名稱 | 複雜度 (GFLOPS) | 大小 (MP) |
---|---|---|
single-image-super-resolution-1032 | 11.654 | 0.030 |
single-image-super-resolution-1033 | 16.062 | 0.030 |
text-image-super-resolution-0001 | 1.379 | 0.003 |
Text Detection / 文字檢測
深度學習模型在文字檢測中進行應用:
模型名稱 | 複雜度 (GFLOPS) | 大小 (MP) |
---|---|---|
text-detection-0003 | 51.256 | 6.747 |
text-detection-0004 | 23.305 | 4.328 |
Text Recognition / 文字識別
深度學習模型在文字識別中應用;
模型名稱 | 複雜度 (GFLOPS) | 大小 (MP) |
---|---|---|
text-recognition-0012 | 1.485 | 5.568 |
handwritten-score-recognition-0003 | 0.792 | 5.555 |
handwritten-japanese-recognition-0001 | 117.136 | 15.31 |
Text Spotting / 文字定位識別
深度學習模型用於文字檢測識別;
模型名稱 | 複雜度 (GFLOPS) | 大小 (MP) |
---|---|---|
text-spotting-0002-detector | 185.169 | 26.497 |
text-spotting-0002-recognizer-encoder | 2.082 | 1.328 |
text-spotting-0002-recognizer-decoder | 0.002 | 0.273 |
Action Recognition Models / 動作識別模型
動作識別模型對一個視訊短片(通過堆疊來自輸入視訊的取樣幀得到的張量)預測動作;
一些模型從不同的視訊片段中提取(比如 driver-action-recognition-adas-0002 可能會使用預計算的高維度)特徵(嵌入) 然後整合到一個臨時模型中,用分類分數來預測一個向量;
計算嵌入的模型稱為 encoder / 編碼器,用來預測真實標籤的模型稱為 decoder / 解碼器;
模型名稱 | 複雜度 (GFLOPS) | 大小 (MP) |
---|---|---|
driver-action-recognition-adas-0002-encoder | 0.676 | 2.863 |
driver-action-recognition-adas-0002-decoder | 0.147 | 4.205 |
action-recognition-0001-encoder | 7.340 | 21.276 |
action-recognition-0001-decoder | 0.147 | 4.405 |
asl-recognition-0004 | 6.660 | 4.133 |
Image Retrieval / 影象檢索
深度學習模型用來進行影象檢索(根據相似度對影象進行排序);
模型名稱 | 複雜度 (GFLOPS) | 大小 (MP) |
---|---|---|
image-retrieval-0001 | 0.613 | 2.535 |
Compressed Models / 壓縮模型
深度學習壓縮模型;
模型名稱 | 複雜度 (GFLOPS) | 大小 (MP) |
---|---|---|
resnet50-binary-0001 | 1.002 | 7.446 |
resnet18-xnor-binary-onnx-0001 | - | - |
歡迎使用 Intel OpenVINO Toolkit 進行 AI 開發,OpenVINO(SW)+ MyriadX VPU(HW) 主要側重於 Inference 推算時的加速,藉助 Intel VPU 可以對邊緣端裝置推演時進行加速;
我會在之後的 blog 裡面更新詳細的 sample code 的用法;
開發過程中若有問題歡迎留言;