cisco-open/DeepVision

Misalignment of frame_id in VideoStream and TrackingStream

Opened this issue · 0 comments

Description

The annotated image shown in dashboard may contain: the latest tracking result in TrackingStream with frame_id "ref_0", and the image in VideoStream with frame_id ("ref_1") that is next to "ref_0". And the frame_id from the two stream might be misaligned by one frame.

That is due to:

In get_last of server.py, (https://github.com/cisco-open/DeepVision/blob/main/server.py#L176)

  • first we get the latest tracking stream item (e.g. with frame "ref_0") (Line 177)
  • Then we retrieve video image data of frame "ref_0", and update the frame_id in the video stream with the next available one (e.g. self.frame_ref_id = "ref_1") (Line 180)
  • However, when calling videostream.get_image_data(), it calls get_stream_item with the updated frame_id ("ref_1") ( self.get_stream_item(self.frame_ref_id)) before loading image data, which results in the data loaded from ("ref_1") instead of the same frame ("ref_0") of the tracking info.

Expected Behavior

The annotated image show the image as well as the tracking info from the same frame.

Actual Behavior

The annotated image show the image with the lagged tracking info by one.

Affected Version

Please provide the version number where this issue was encountered.

Steps to Reproduce

  1. First step
  2. Second step
  3. etc.

Checklist