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