점유 분석 모델을 사용하면 동영상 프레임에 추가한 특정 입력값을 토대로 사람 또는 차량을 집계할 수 있습니다. 사람 및 차량 감지기 모델과 비교하여, 숙박 인원 분석 모델에는 고급 기능이 제공됩니다.
이러한 기능은 활동 감지 구역 집계, 선 교차 집계, 거주 감지입니다.
활성 영역을 사용하면 사용자가 특정 사용자 정의 영역에서 사람 또는 차량을 집계할 수 있습니다.
선 교차는 객체가 특정 선을 교차하는 방향을 계산하는 기능을 제공합니다.
체류 시간 감지는 활성 영역을 기반으로 하며 물체가 최소 시간 동안 영역에 머물렀는지 여부를 감지하는 기능을 제공합니다.
이 모델은 동영상 스트림을 입력으로 받아 각 프레임에서 감지된 사람과 차량의 수를 포함하는 프로토콜 버퍼를 출력합니다. 모델은 6FPS로 실행됩니다.
사용 사례: 스마트 시티 트래픽 분석
다음 동영상에서는 Vertex AI Vision을 사용하여 객실 점유 분석 애플리케이션을 만들고 빌드하고 배포하는 방법을 보여줍니다.
이 애플리케이션은 사용자가Google Cloud 콘솔에서 지정한 교차로의 선을 교차하는 자동차 수를 집계하는 모델을 사용합니다. 또한 애플리케이션은 사람 흐리게 처리 모델을 사용하여 동영상 피드 소스에 표시되는 모든 사용자의 신원을 보호합니다.
애플리케이션은 분석된 데이터를 미디어 저장을 위해 Vertex AI Vision의 Media Warehouse로 전송하고, 구조화된 데이터를 테이블에 저장하기 위해 BigQuery로 전송합니다. 창고를 사용하면 차량 수나 사람 수와 같은 모델의 기준에 따라 저장된 데이터를 검색할 수 있습니다. BigQuery의 테이블 데이터를 사용하면 데이터를 쿼리하여 분석 정보를 가져올 수 있습니다.
모델 출력
사람 및 차량 감지에는 현재 처리된 프레임에서 감지된 사람 및 차량 수가 표시됩니다. 개수 유형은 사용자가 제공한 주석 입력을 기반으로 합니다. 원시 감지 및 추적 결과도 출력에 포함됩니다.
다음은 프로세서 출력의 프로토콜 버퍼 정의입니다. 출력 스트림의 주파수는 일정하며 초당 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% 입니다. 타겟팅하는 사람과 차량이 카메라에서 너무 멀리 있지 않은지 확인합니다. 이러한 키 객체의 표시 크기는 충분히 커야 합니다.
관심 장소에 적절한 조명이 있어야 합니다.
동영상 소스 카메라 렌즈가 깨끗한지 확인합니다.
사람 또는 자동차가 아닌 항목이 카메라 시야의 일부를 가리지 않도록 합니다.
다음 요소는 모델의 성능을 저하시킬 수 있습니다. 데이터 소스를 찾을 때 다음 요소를 고려하세요.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-11(UTC)"],[],[],null,["# Occupancy analytics guide\n\nThe **Occupancy analytics** model lets you count people or vehicles given\nspecific inputs you add in video frames. Compared with the Person Vehicle\nDetector model, advanced features are provided in the Occupancy Analytics model.\nThese features are active zones counting, line crossing counting, and dwelling\ndetection.\n\n- Active zones let users count people or vehicles in specific user-defined zones.\n- Line crossing provides the ability to count the direction in which an object crosses a particular line.\n- Dwell time detection builds on active zones and provides the ability to detect whether or not objects have remained in a zone for a minimal amount of time.\n\nThe model accepts a video stream as input and outputs a\n[protocol buffer](https://developers.google.com/protocol-buffers/docs/overview) with a count of detected people and vehicles\nin each frame. The model runs at six FPS.\n\nUse case: Smart city traffic analytics\n--------------------------------------\n\nThe following video shows how you can use Vertex AI Vision to create, build,\nand deploy an occupancy analytics application.\n\nThis application uses a model\ncounts cars that cross lines in intersections that the user specifies in the\nGoogle Cloud console. Additionally, the application uses\na person blur model to protect the identity of anyone that appears in the\nvideo feed sources.\n\nThe application sends analyzed data to a Vertex AI Vision's Media Warehouse\nfor media storage, and also to BigQuery to store structured data in a\ntable. The warehouse lets you search stored data on criteria from the\nmodels, such as number of vehicles or people. The table data in\nBigQuery lets you query the data for analytic information. \n\nModel output\n------------\n\nPerson Vehicle Detection shows the number of people and vehicles detected in\nthe current processed frame. The type of count is based on user-provided\nannotation input. The raw detection and tracking results are also in the output.\nBelow is the [protocol buffer](https://developers.google.com/protocol-buffers/docs/overview) definition of the processor\noutput. The frequency of the output stream is constant: three frames per second. \n\n```\n// The prediction result proto for Person/Vehicle Detection.\nmessage OccupancyCountingPredictionResult {\n\n // Current timestamp.\n google.protobuf.Timestamp current_time = 1;\n\n // The entity info for annotations from the processor.\n message Entity {\n // Label id.\n int64 label_id = 1;\n // Human readable string of the label.\n string label_string = 2;\n }\n\n // Identified box contains location and the entity of the object.\n message IdentifiedBox {\n // An unique id for this box.\n int64 box_id = 1;\n // Bounding Box in the normalized coordinates.\n message NormalizedBoundingBox {\n // Min in x coordinate.\n float xmin = 1;\n // Min in y coordinate.\n float ymin = 2;\n // Width of the bounding box.\n float width = 3;\n // Height of the bounding box.\n float height = 4;\n }\n\n // Bounding Box in the normalized coordinates.\n NormalizedBoundingBox normalized_bounding_box = 2;\n\n // Confidence score associated with this box.\n float score = 3;\n\n // Entity of this box.\n Entity entity = 4;\n\n // A unique id to identify a track. It must be consistent across frames.\n // It only exists if tracking is enabled.\n int64 track_id = 5;\n }\n\n // A list of identified boxes.\n repeated IdentifiedBox identified_boxes = 2;\n\n // The statistics info for annotations from the processor.\n message Stats {\n // The object info and count for annotations from the processor.\n message ObjectCount {\n // Entity of this object.\n Entity entity = 1;\n // Count of the object.\n int32 count = 2;\n }\n\n // Counts of the full frame.\n repeated ObjectCount full_frame_count = 1;\n\n // Message for Crossing line count.\n message CrossingLineCount {\n // Line annotation from the user.\n StreamAnnotation annotation = 1;\n // The direction that follows the right hand rule.\n repeated ObjectCount positive_direction_counts = 2;\n // The direction that is opposite to the right hand rule.\n repeated ObjectCount negative_direction_counts = 3;\n }\n\n // Crossing line counts.\n repeated CrossingLineCount crossing_line_counts = 2;\n\n // Message for the active zone count.\n message ActiveZoneCount {\n // Active zone annotation from the user.\n StreamAnnotation annotation = 1;\n // Counts in the zone.\n repeated ObjectCount counts = 2;\n }\n\n // Active zone counts.\n repeated ActiveZoneCount active_zone_counts = 3;\n }\n\n // Detection statistics.\n Stats stats = 3;\n\n // The track info for annotations from the processor.\n message TrackInfo {\n // A unique id to identify a track. It must be consistent across frames.\n string track_id = 1;\n // Start timestamp of this track.\n google.protobuf.Timestamp start_time = 2;\n }\n\n // The dwell time info for annotations from the processor.\n message DwellTimeInfo {\n // A unique id to identify a track. It must be consistent across frames.\n string track_id = 1;\n // The unique id for the zone in which the object is dwelling/waiting.\n string zone_id = 2;\n // The beginning time when a dwelling object has been identified in a zone.\n google.protobuf.Timestamp dwell_start_time = 3;\n // The end time when a dwelling object has exited in a zone.\n google.protobuf.Timestamp dwell_end_time = 4;\n }\n\n // Track related information. All the tracks that are live at this timestamp.\n // It only exists if tracking is enabled.\n repeated TrackInfo track_info = 4;\n\n // Dwell time related information. All the tracks that are live in a given\n // zone with a start and end dwell time timestamp\n repeated DwellTimeInfo dwell_time_info = 5;\n}\n```\n\nBest practices and limitations\n------------------------------\n\n- Avoid unusual camera viewpoints (for example, a top-down view) where people and vehicles appear differently from a standard or common view of them. The detection quality can be largely impacted by unusual views.\n- Ensure that people and vehicles are fully or mostly visible. The detection quality can be affected by partial occlusion by other objects.\n- The person vehicle detector has a minimal detectable object size. This size is approximately 2% with respect to the size of the camera view. Ensure that the target people and vehicles aren't too far away from the camera. These key objects' viewable sizes must be sufficiently large.\n- Areas of interest must have proper lighting.\n- Ensure the video source camera lens is clean.\n- Ensure entities (other than people or cars) don't obstruct any part of the camera's field of view.\n- The following factors might degrade the model's performance. Consider these factors when you source data:\n - Poor lighting conditions.\n - Crowdedness and object occlusions.\n - Uncommon or less common viewpoints.\n - Small object sizes."]]