+-------------------------------------------+
| feed_forward |
+-------------------------------------------+
| inputs |
| typing.List[BaseMessage] |
+-------------------------------------------+
| msg |
| typing.cast |
| | |
| V |
| Message |
+-------------------------------------------+
| detections |
| typing.cast(typing.List[ |
| Detection]) |
+-------------------------------------------+
| image_with_origin |
| typing.cast(ImageWithOrigin, |
| msg.image_with_origin) |
+-------------------------------------------+
| now |
| image_with_origin.timestamp |
+-------------------------------------------+
| update_config |
+-------------------------------------------+
| scan_events |
| msg.extras.get("SCAN_EVENTS", None) |
+-------------------------------------------+
| endevent_time |
| scan_events.get_most_recent_end_event |
| (True, now) |
+-------------------------------------------+
| missed_scans, valid_scans, |
| hidden_scans, unscanned, |
| actual_scans, _ |
| self.get_product_count(now, scan_events)|
+-------------------------------------------+
| msg.extras["zone_tracker_metrics"] |
| {"missed_scans": missed_scans, |
| "hidden_scans": hidden_scans, |
| "valid_scans": valid_scans, |
| "actual_scans": actual_scans, |
| "unscanned": unscanned} |
+-------------------------------------------+
| logging.info("Session Summary:") |
| logging.info(f"Missed Scans: {missed_} |
| logging.info(f"Valid Scans: {valid_s}|
| logging.info(f"Hidden: {hidden_scans}")|
| scan_events.reset_scan_count() |
| self.reset_track_zone_records() |
+-------------------------------------------+
| det (loop) |
| detections |
+-------------------------------------------+
| det.cls not in self._tracking_ |
| classes or det.track_id |
| is None |
| | |
| V |
| continue |
+-------------------------------------------+
| in_basket_trolley |
| det.extras.get("in_basket_ |
| trolley", False) |
+-------------------------------------------+
| in_bag |
| det.extras.get("in_bag", False) |
+-------------------------------------------+
| current_zone_name |
| self.get_zone_name(det) |
+-------------------------------------------+
| track |
| self._track_zone_records.get(det.track_id)|
+-------------------------------------------+
| track.get_last_zone_name() != |
| current_zone_name and |
| current_zone_name is not None |
| | |
| V |
| track.zone_records.append( |
| ZoneRecord(current_zone_name, now, |
| in_basket_trolley, in_bag)) |
+-------------------------------------------+
| track.last_time = now |
+-------------------------------------------+
| zone_records |
| [] |
+-------------------------------------------+
| current_zone_name is not None |
| | |
| V |
| record = ZoneRecord( |
| current_zone_name, now, |
| in_basket_trolley, in_bag) |
| zone_records.append(record) |
+-------------------------------------------+
| track = TrackRecord(now, now, |
| zone_records) |
+-------------------------------------------+
| self._track_zone_records[det.track_id] = |
| track |
+-------------------------------------------+
| track.is_still = det.extras.get( |
| "is_still", True) |
+-------------------------------------------+
| track.in_basket_trolley_now = |
| in_basket_trolley |
+-------------------------------------------+
| self._track_zone_records[det.track_id] |
|.movement_count = det.extras.get( |
| "movement_count", 0) |
+-------------------------------------------+
| len(track.zone_records) > 0 |
| | |
| V |
| track.zone_records[-1].in_bag |= in_bag |
|track.zone_records[-1].in_basket_trolley |= |
| in_basket_trolley |
+-------------------------------------------+
| track.hand_count = det.extras.get( |
| "hand_count", 0) |
+-------------------------------------------+
| track.class_counts[det.cls] += 1 |
+-------------------------------------------+
| self.check_for_similar_tracks(detections)|
+-------------------------------------------+
| self.detect_missed_scans(now, scan_events)|
+-------------------------------------------+
| self.report_fraud_alerts(msg, now, scan_events)|
+-------------------------------------------+
| msg |
+-------------------------------------------+