
占有率アナリティクス モデルを使用すると、動画フレームに追加した特定の入力に基づいて、人や車両の数をカウントできます。人物と車両検出モデルと比較して、占有状況分析モデルには高度な機能が用意されています。これらの機能は、アクティブ ゾーン カウント、ラインクロス カウント、滞在検出です。
- アクティブ ゾーンを使用すると、ユーザー定義の特定のゾーンで人や車両をカウントできます。
- ラインクロスを使用すると、オブジェクトが特定の線を横切る方向をカウントできます。
- 滞在時間の検出はアクティブ ゾーンに基づいており、オブジェクトがゾーン内に最小限の時間留まっているかどうかを検出できます。
このモデルは動画ストリームを入力として受け取り、各フレームで検出された人物と車両の数を含むプロトコル バッファを出力します。モデルは 6 FPS で実行されます。
ユースケース: スマートシティの交通分析
次の動画では、Vertex AI Vision を使用して、占有率分析アプリケーションを作成、構築、デプロイする方法について説明します。
このアプリケーションは、ユーザーが Google Cloud コンソールで指定した交差点で線を横切る車をカウントするモデルを使用します。また、このアプリでは人物ぼかしモデルを使用して、動画フィード ソースに表示される人物の ID を保護します。
アプリケーションは、分析されたデータを Vertex AI Vision の Media Warehouse に送信してメディアを保存し、BigQuery に送信して構造化データをテーブルに保存します。ウェアハウスを使用すると、車両数や人数などのモデルの条件に基づいて保存されているデータを検索できます。BigQuery のテーブルデータでは、分析情報についてデータをクエリできます。
モデル出力
人物と車両の検出では、現在処理中のフレームで検出された人物と車両の数が表示されます。カウントのタイプは、ユーザー提供のアノテーション入力に基づいています。未加工の検出結果とトラッキング結果も出力されます。以下は、プロセッサ出力のプロトコル バッファ定義です。出力ストリームの頻度は一定で、1 秒あたり 3 フレームです。
// 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 processor. 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 unique id to identify a track. It must be consistent across frames. // It only exists if tracking is enabled. int64 track_id = 5; } // A list of identified boxes. repeated IdentifiedBox identified_boxes = 2; // The statistics info for annotations from the processor. message Stats { // The object info and count for annotations from the processor. 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; // Message for Crossing line count. message CrossingLineCount { // Line annotation from the user. StreamAnnotation annotation = 1; // The direction that follows the right hand rule. repeated ObjectCount positive_direction_counts = 2; // The direction that is opposite to the right hand rule. repeated ObjectCount negative_direction_counts = 3; } // Crossing line counts. repeated CrossingLineCount crossing_line_counts = 2; // Message for the active zone count. message ActiveZoneCount { // Active zone annotation from the user. StreamAnnotation annotation = 1; // Counts in the zone. repeated ObjectCount counts = 2; } // Active zone counts. repeated ActiveZoneCount active_zone_counts = 3; } // Detection statistics. Stats stats = 3; // The track info for annotations from the processor. message TrackInfo { // A unique id to identify a track. It must be consistent across frames. string track_id = 1; // Start timestamp of this track. google.protobuf.Timestamp start_time = 2; } // The dwell time info for annotations from the processor. message DwellTimeInfo { // A unique id to identify a track. It must be consistent across frames. string track_id = 1; // The unique id for the zone in which the object is dwelling/waiting. string zone_id = 2; // The beginning time when a dwelling object has been identified in a zone. google.protobuf.Timestamp dwell_start_time = 3; // The end time when a dwelling object has exited in a zone. google.protobuf.Timestamp dwell_end_time = 4; } // Track related information. All the tracks that are live at this timestamp. // It only exists if tracking is enabled. repeated TrackInfo track_info = 4; // Dwell time related information. All the tracks that are live in a given // zone with a start and end dwell time timestamp repeated DwellTimeInfo dwell_time_info = 5; }
ベスト プラクティスと制限事項
- 人物や車両が標準的な視点や一般的な視点とは異なるように見える、通常とは異なるカメラの視点(上から下への視点など)は避けてください。検出品質は、異常な視聴によって大きく影響を受ける可能性があります。
- 人や車両が完全に、またはほとんど映っていることを確認します。検出品質は、他のオブジェクトによる部分的な遮蔽の影響を受ける可能性があります。
- 人物と車両の検出機能には、検出可能な最小オブジェクト サイズがあります。このサイズは、カメラビューのサイズに対して約 2% です。対象の人や車両がカメラから遠すぎないことを確認します。これらのキー オブジェクトの表示サイズは十分に大きくする必要があります。
- 被写体は適切に照明されている必要があります。
- 動画ソースのカメラレンズがきれいであることを確認します。
- 人物や車以外の物体がカメラの視野の一部を遮らないようにします。
- 次の要因により、モデルのパフォーマンスが低下する可能性があります。データを取得する際は、次の要素を考慮してください。
- 照明が不十分な場所。
- 混雑や物体の遮蔽。
- 珍しい、またはあまり一般的でない視点。
- 小さなオブジェクト サイズ。