
המודל Occupancy analytics מאפשר לספור אנשים או כלי רכב על סמך קלט ספציפי שמוסיפים למסגרות של סרטונים. בהשוואה למודל Person Vehicle Detector, מודל Occupancy Analytics מספק תכונות מתקדמות. התכונות האלה הן ספירת אזורים פעילים, ספירת מעברים של קו וזיהוי של שהייה.
- באמצעות אזורים פעילים, המשתמשים יכולים לספור אנשים או כלי רכב באזורים ספציפיים שהם מגדירים.
- התכונה 'חציית קו' מאפשרת לספור את הכיוון שבו אובייקט חוצה קו מסוים.
- זיהוי זמן שהייה מבוסס על אזורים פעילים, ומאפשר לזהות אם אובייקטים נשארו באזור למשך זמן מינימלי.
המודל מקבל כקלט סטרימינג של וידאו ומפיק מאגר אחסון לפרוטוקולים עם ספירה של אנשים וכלי רכב שזוהו בכל פריים. המודל פועל ב-6 FPS.
תרחיש שימוש: ניתוח תנועת גולשים בעיר חכמה
בסרטון הבא מוצג איך אפשר להשתמש ב-Gemini Enterprise Agent Platform Vision כדי ליצור, לבנות ולפרוס אפליקציה לניתוח נתוני תפוסה.
האפליקציה הזו משתמשת במודל שסופר מכוניות שחוצות קווים בצמתים שהמשתמש מציין בGoogle Cloud מסוף. בנוסף, האפליקציה משתמשת במודל לטשטוש אנשים כדי להגן על הזהות של כל מי שמופיע במקורות של פיד הסרטונים.
האפליקציה שולחת נתונים מנותחים אל Media Warehouse של Gemini Enterprise Agent Platform Vision לאחסון מדיה, וגם אל BigQuery לאחסון נתונים מובְנים בטבלה. מחסן הנתונים מאפשר לכם לחפש נתונים מאוחסנים לפי קריטריונים מהמודלים, כמו מספר כלי רכב או מספר אנשים. הנתונים בטבלה ב-BigQuery מאפשרים לכם להריץ שאילתות על הנתונים כדי לקבל מידע אנליטי.
פלט המודל
המדד 'זיהוי אנשים ורכבים' מציג את מספר האנשים והרכבים שזוהו בפריים הנוכחי שעבר עיבוד. סוג הספירה מבוסס על קלט של הערות שסופקו על ידי המשתמש. הפלט כולל גם את תוצאות הזיהוי והמעקב הגולמיות. בהמשך מופיעה ההגדרה של פלט המעבד בפרוטוקול buffer. התדירות של זרם הפלט קבועה: שלושה פריימים לשנייה.
// 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% ביחס לגודל שידור מהמצלמה. מוודאים שאנשים וכלי רכב שמטרגטים אותם לא רחוקים מדי מהמצלמה. הגודל של האובייקטים המרכזיים האלה צריך להיות גדול מספיק.
- התאורה באזורים שמעניינים אתכם צריכה להיות טובה.
- מוודאים שעדשת המצלמה של מקור הווידאו נקייה.
- מוודאים שישויות (מלבד אנשים או מכוניות) לא חוסמות אף חלק משדה הראייה של המצלמה.
- הגורמים הבאים עלולים לפגוע בביצועי המודל. כשמקור הנתונים הוא חיצוני, חשוב להתייחס לגורמים הבאים:
- תנאי תאורה גרועים.
- צפיפות והסתרה של אובייקטים.
- נקודות מבט לא שכיחות או פחות שכיחות.
- גודל קטן של אובייקטים.