점유 분석 모델을 사용하면 동영상 프레임에 추가하는 특정 입력을 기준으로 사람 또는 차량을 집계할 수 있습니다. 점유 분석 모델은 사람 차량 감지기 모델과 비교하여 고급 기능을 제공합니다. 이러한 기능에는 활성 영역 집계, 선 교차 집계, 체류 감지가 포함됩니다.
- 활성 영역을 사용하면 사용자가 특정 사용자 정의 영역에서 사람 또는 차량을 집계할 수 있습니다.
- 선 교차는 객체가 특정 선을 교차하는 방향을 집계하는 기능을 제공합니다.
- 체류 시간 감지는 활성 영역을 기반으로 하며 객체가 최소 시간 동안 영역에 남아 있는지 감지하는 기능을 제공합니다.
모델은 동영상 스트림을 입력으로 허용하고 각 프레임에서 감지된 사람과 차량의 수가 포함된 프로토콜 버퍼를 출력합니다. 모델은 6FPS로 실행됩니다.
사용 사례: 스마트 시티 트래픽 분석
다음 동영상에서는 Gemini Enterprise 에이전트 플랫폼 Vision을 사용하여 점유 분석 애플리케이션을 만들고 빌드하고 배포하는 방법을 보여줍니다.
이 애플리케이션은 사용자가 콘솔에서 Google Cloud 지정한 교차로에서 선을 교차하는 차량을 집계하는 모델을 사용합니다. 또한 이 애플리케이션은 동영상 피드 소스에 표시되는 모든 사용자의 신원을 보호하기 위해 사람 흐림 모델을 사용합니다.
애플리케이션은 분석된 데이터를 미디어 저장을 위해 Gemini Enterprise 에이전트 플랫폼 Vision의 미디어 웨어하우스로 전송하고, 구조화된 데이터를 테이블에 저장하기 위해 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% 입니다. 타겟 사람과 차량이 카메라에서 너무 멀리 떨어져 있지 않은지 확인합니다. 이러한 주요 객체의 표시 가능한 크기는 충분히 커야 합니다.
- 관심 영역에는 적절한 조명이 있어야 합니다.
- 동영상 소스 카메라 렌즈가 깨끗한지 확인합니다.
- 사람 또는 차량 이외의 항목이 카메라의 시야를 가리지 않도록 합니다.
- 다음 요소는 모델의 성능을 저하시킬 수 있습니다. 데이터를 소싱할 때 다음 요소를 고려하세요.
- 조명 조건이 좋지 않음
- 혼잡도 및 객체 폐색
- 일반적이지 않거나 덜 일반적인 뷰포인트
- 작은 객체 크기