人車偵測工具指南

控制台中的人車偵測模型資訊卡

人車偵測工具模型可偵測影片影格中的人物或車輛*,並計算其數量。這個模型會接受影片串流做為輸入內容,並輸出通訊協定緩衝區,其中包含每個影格中偵測到的人員和車輛數量。模型的執行速度為 6 FPS。

* 汽車、公車、卡車、自行車、機車和救護車。

模型輸出

人車偵測模型會顯示目前處理影格中偵測到的人物和車輛數量。以下是模型輸出的通訊協定緩衝區定義。輸出串流的頻率固定為每秒一幀。

// The prediction result proto for Person/Vehicle Detection.
message OccupancyCountingPredictionResult {

 // Current timestamp.
 google.protobuf.Timestamp current_time = 1;

 // The entity info for annotations from the model.
 message Entity {
   // Label id.
   int64 label_id = 1;
   // Human readable string of the label.
   string label_string = 2;
 }

 // Identified box contains location and the entity of the object.
 message IdentifiedBox {
   // An unique id for this box.
   int64 box_id = 1;
   // 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;
   }
   // Bounding Box in the normalized coordinates.
   NormalizedBoundingBox normalized_bounding_box = 2;
   // Confidence score associated with this box.
   float score = 3;
   // Entity of this box.
   Entity entity = 4;
 }

 // A list of identified boxes.
 repeated IdentifiedBox identified_boxes = 2;

 // The statistics info for annotations from the model.
 message Stats {
   // The object info and count for annotations from the model.
   message ObjectCount {
     // Entity of this object.
     Entity entity = 1;
     // Count of the object.
     int32 count = 2;
   }
   // Counts of the full frame.
   repeated ObjectCount full_frame_count = 1;
 }

 // Detection statistics.
 Stats stats = 3;
}

最佳做法和限制

  • 避免使用不尋常的攝影機視角 (例如由上而下的視角),因為這類視角會讓人和車輛看起來與標準或常見視角不同。不尋常的觀看行為可能會大幅影響偵測品質。
  • 確保人物和車輛完全或大部分可見。偵測品質可能會受到其他物體部分遮蔽的影響。
  • 人車偵測工具有可偵測的物件大小下限。相對於相機視圖的大小,這個大小約為 2%。確保目標人物和車輛不會離攝影機太遠。這些主要物件的可視大小必須足夠大。
  • 感興趣的領域必須有適當的光線。
  • 確認影片來源相機鏡頭乾淨清潔。
  • 確認實體 (不包括人或車輛) 不會遮住攝影機的任何視野範圍。
  • 以下因素可能會降低模型效能。取得資料時,請考量下列因素:
    • 光線條件不佳。
    • 人群擁擠和物體遮蔽。
    • 不常見的觀點。
    • 小物件尺寸。