
個人防護裝備 (PPE) 偵測器模型可協助您確認工作場所或社區環境中是否有可限制危險因子暴露的裝備。
模型會偵測特定人物,以及該人物身上的 PPE 項目 (手套、口罩和頭盔)。模型會偵測 PPE 項目,以及這些項目是否覆蓋對應的人體部位。模型會將這項涵蓋率資訊做為涵蓋率分數回報,範圍為 [0, 1]。這個模型會將影片串流做為輸入內容。模型會將偵測結果輸出為通訊協定緩衝區,您可以在 BigQuery 中查看這些結果。模型以 1 FPS 的速度執行。
PPE 偵測運算子有三個可設定的控制參數:
PersonalProtectiveEquipmentDetectionConfig
中將enableHeadCoverageDetection
設為 true。
頭部護具:操作員會輸出頭部護具相關的 PPE 項目資訊。您可以在 Google Cloud 主控台中設定這個值,或是在 PersonalProtectiveEquipmentDetectionConfig
中將enableFaceCoverageDetection
設為 true。
口罩:運算子會輸出與口罩相關的 PPE 項目資訊。您可以在 Google Cloud 主控台中設定這個值,或是在 PersonalProtectiveEquipmentDetectionConfig
中將enableHandsCoverageDetection
設為 true。
手套:作業員會輸出手部防護相關的個人防護裝備項目資訊。您可以在 Google Cloud 主控台中設定這個值,或是在
PPE 偵測工具模型應用程式規格
請按照下列操作說明,在Google Cloud 控制台中建立 PPE 偵測器模型。
主控台
在 Google Cloud 控制台中建立應用程式
如要建立 PPE 偵測器應用程式,請按照「建構應用程式」中的指示操作。
新增 PPE 偵測工具模型
新增模型節點時,請從預先訓練模型清單中選取「PPE detector」。
在選項選單中設定要偵測的 PPE 類型。
新增 BigQuery 連接器
如要使用輸出內容,請將應用程式連結至 BigQuery 連接器。
如要瞭解如何使用 BigQuery 連接器,請參閱「將資料連結並儲存至 BigQuery」一文。如要瞭解 BigQuery 的定價資訊,請參閱 BigQuery 定價頁面。
在 BigQuery 中查看輸出結果
模型將資料輸出至 BigQuery 後,請在 BigQuery 資訊主頁中查看輸出註解。
如果您未指定 BigQuery 路徑,可以在 Vertex AI Vision
Studio 頁面中查看系統建立的路徑。在 Google Cloud 控制台開啟「BigQuery」頁面。
選取目標專案、資料集名稱和應用程式名稱旁的
「展開」。在資料表詳細資料檢視畫面中,按一下「預覽」。查看「註解」欄中的結果。如需輸出格式的說明,請參閱「模型輸出內容」。
應用程式會依時間順序儲存結果。最舊的結果會顯示在表格的開頭,而最新的結果則會新增至表格的結尾。如要查看最新結果,請按一下頁碼,前往最後一個表格頁面。
模型輸出
模型輸出內容包括時間戳記、偵測框、與框相對應的物件標籤,以及該物件的可信度分數。輸出串流的速率為每秒一幀。
模型輸出內容為 protocol buffer 格式,其中包含影片影格和 PPE 偵測預測結果的資訊。該模型的目標是檢查人員是否正確穿戴防護裝備。因此,模型會著重於偵測人員和人員所穿的 PPE。模型輸出內容著重於人類偵測。對於每位偵測到的人員,模型會列出該人員周圍的 PPE,以及每項裝備的覆蓋率分數。
在下列的通訊協定緩衝區範例中,請注意下列事項。
- 目前時間:時間戳記會記錄推論結果的時間。
- 偵測到的人員:主要偵測結果,包含一個人員辨識框、多個 PPE 辨識框,以及每個身體部位的覆蓋率分數。
- 人物識別框:定界框、可信度分數和人物實體。
- PPE 識別框:定界框、可信度分數和 PPE 實體。
註解輸出 JSON 物件的範例
{ "currentTime": "2022-11-10T21:02:13.499255040Z", "detectedPersons": [ { "personId": "0", "detectedPersonIdentifiedBox": { "boxId": "0", "normalizedBoundingBox": { "xmin": 0.486749, "ymin": 0.35927793, "width": 0.048630536, "height": 0.21746585 }, "confidenceScore": 0.31775203, "personEntity":{ "personEntityId":"0" } }, "detected_ppe_identified_boxes": { "normalized_bounding_box": { "xmin": 0.07268746, "ymin": 0.80575824, "width": 0.22973709, "height": 0.18754286 }, "confidence_score": 0.45171335, "ppe_entity": { "ppe_label_string": "Glove", "ppe_supercategory_label_string": "Hand Coverage" } }, "detected_ppe_identified_boxes":{ "normalized_bounding_box":{ "xmin": 0.35457548, "ymin": 0.016402662, "width": 0.31828704, "height": 0.18849815 }, "confidence_score": 0.44129524, "ppe_entity":{ "ppe_label_string": "Helmet", "ppe_supercategory_label_string": "Head Coverage" } } } ] }
通訊協定緩衝區定義
// Output format for Personal Protective Equipment Detection Operator
message PersonalProtectiveEquipmentDetectionOutput {
// Current timestamp
protobuf.Timestamp current_time = 1;
// The entity info for annotations from person detection prediction result
message PersonEntity {
// Entity id
int64 person_entity_id = 1;
}
// The entity info for annotations from PPE detection prediction result
message PPEEntity {
// Label id
int64 ppe_label_id = 1;
// Human readable string of the label (Examples: helmet, glove, mask)
string ppe_label_string = 2;
// Human readable string of the super category label (Examples: head_cover,
// hands_cover, face_cover)
string ppe_supercategory_label_string = 3;
// Entity id
int64 ppe_entity_id = 4;
}
// Bounding Box in the normalized coordinates
message NormalizedBoundingBox {
// Min in x coordinate
float xmin = 1;
// Min in y coordinate
float ymin = 2;
// Width of the bounding box
float width = 3;
// Height of the bounding box
float height = 4;
}
// PersonIdentified box contains the location and the entity info of the
// person
message PersonIdentifiedBox {
// An unique id for this box
int64 box_id = 1;
// Bounding Box in the normalized coordinates
NormalizedBoundingBox normalized_bounding_box = 2;
// Confidence score associated with this box
float confidence_score = 3;
// Person entity info
PersonEntity person_entity = 4;
}
// PPEIdentified box contains the location and the entity info of the PPE
message PPEIdentifiedBox {
// An unique id for this box
int64 box_id = 1;
// Bounding Box in the normalized coordinates
NormalizedBoundingBox normalized_bounding_box = 2;
// Confidence score associated with this box
float confidence_score = 3;
// PPE entity info
PPEEntity ppe_entity = 4;
}
// Detected Person contains the detected person and their associated
// PPE and their protecting information
message DetectedPerson {
// The id of detected person
int64 person_id = 1;
// The info of detected person identified box
PersonIdentifiedBox detected_person_identified_box = 2;
// The info of detected person associated ppe identified boxes
repeated PPEIdentifiedBox detected_ppe_identified_boxes = 3;
// Coverage score for each body part
// Coverage score for face
optional float face_coverage_score = 4;
// Coverage score for eyes
optional float eyes_coverage_score = 5;
// Coverage score for head
optional float head_coverage_score = 6;
// Coverage score for hands
optional float hands_coverage_score = 7;
// Coverage score for body
optional float body_coverage_score = 8;
// Coverage score for feet
optional float feet_coverage_score = 9;
}
// A list of DetectedPersons
repeated DetectedPerson detected_persons = 2;
}
最佳做法和限制
為確保使用 PPE 偵測器時能獲得最佳結果,請在取得資料和使用模型時考量以下事項。
來源資料建議
建議做法:盡可能讓偵測對象站著不動,並面向攝影機。
PPE 偵測工具可正確處理的圖片資料範例:
![]() |
![]() |
![]() |
不建議:請避免在圖片資料中,讓主要個人防護裝備項目在畫面中過小。
以下是 PPE 偵測器無法正確處理的圖片資料範例:
![]() |
不建議:請勿使用從不尋常視角或不規則角度拍攝的圖片資料,顯示主要個人防護裝備項目。
以下是 PPE 偵測器無法正確處理的圖片資料範例:
![]() |
限制
- 解析度:建議的輸入影片解析度上限為 1920 x 1080,建議的解析度下限為 160 x 120。
- 可偵測的物件大小下限:模型會忽略場景中占用影格大小 5% 以下的任何物件。
- 光源:影片光源應為正常。影片資料的亮度或暗度過高或過低,可能會導致偵測器效能降低。
- 個人防護裝備 (PPE) 物品放置位置:PPE 模型著重於分析使用者是否正確使用個人防護裝備物品。因此,如果某人未配戴個人防護裝備,模型就會忽略該裝備。
- PPE 項目類型:模型著重於建築防護裝備,不包含醫療 PPE 項目。因此,偵測器可能無法在醫療中心或醫院中正常運作。
- 自訂 PPE 類型:PPE 模型不支援客戶定義的 PPE 項目。這個模型可偵測頭盔、口罩和手套。
這份清單並未列舉所有內容,且這些限制和功能可能會在日後的產品修改中變更。