Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Images or Cameras #32

Closed
hafidh561 opened this issue Nov 6, 2022 · 6 comments
Closed

Multiple Images or Cameras #32

hafidh561 opened this issue Nov 6, 2022 · 6 comments

Comments

@hafidh561
Copy link

hafidh561 commented Nov 6, 2022

Hello, I have questions about, How to implement deep sort with multiple images or cameras with different views? Because the readme doesn't have a configuration for multiple images or cameras with different views, just only single images or cameras. Thanks

@romarcg
Copy link

romarcg commented Nov 9, 2022

If I understood your question, you should add your own frame reading logic to the readme example, like so:


from deep_sort_realtime.deepsort_tracker import DeepSort
# define your deepsort tracker
tracker = DeepSort(max_age=5)

# initialize your frame reader (e.g., individual file data loader, opencv video stream)
reader = init_reader()
# read frame and process it until end_condition is met, e.g., no more frames in video
while (not end_condition):
  # read frame
  frame = reader.read_frame()
  # detect objects in frame
  bbs = object_detector.detect(frame) 
  tracks = tracker.update_tracks(bbs, frame=frame) # bbs expected to be a list of detections, each in tuples of ( [left,top,w,h], confidence, detection_class )
  for track in tracks:
      if not track.is_confirmed():
          continue
      track_id = track.track_id
      ltrb = track.to_ltrb()
  # update end_condition

reader.close_reader()

@levan92
Copy link
Owner

levan92 commented Nov 9, 2022

Multi-object tracking algorithms like DeepSORT here works within the context of one camera view. You may independently run an instance of DeepSORT for each of your cameras, that is up to your implementation. If you want to track across different cameras, then that's another task -- you may want to check out person re-identification algorithms and build your own re-id engine.

@hafidh561
Copy link
Author

Multi-object tracking algorithms like DeepSORT here works within the context of one camera view. You may independently run an instance of DeepSORT for each of your cameras, that is up to your implementation. If you want to track across different cameras, then that's another task -- you may want to check out person re-identification algorithms and build your own re-id engine.

Thanks, so if I use weights from person re-id and use DeepSORT it's actually not working, am I right?

@hafidh561
Copy link
Author

If I understood your question, you should add your own frame reading logic to the readme example, like so:


from deep_sort_realtime.deepsort_tracker import DeepSort
# define your deepsort tracker
tracker = DeepSort(max_age=5)

# initialize your frame reader (e.g., individual file data loader, opencv video stream)
reader = init_reader()
# read frame and process it until end_condition is met, e.g., no more frames in video
while (not end_condition):
  # read frame
  frame = reader.read_frame()
  # detect objects in frame
  bbs = object_detector.detect(frame) 
  tracks = tracker.update_tracks(bbs, frame=frame) # bbs expected to be a list of detections, each in tuples of ( [left,top,w,h], confidence, detection_class )
  for track in tracks:
      if not track.is_confirmed():
          continue
      track_id = track.track_id
      ltrb = track.to_ltrb()
  # update end_condition

reader.close_reader()

Sorry if my question it's not clear enough. I mean another camera view, not just a single camera. If using this, it's not working in multiple camera views.

@levan92
Copy link
Owner

levan92 commented Nov 9, 2022

Multi-object tracking algorithms like DeepSORT here works within the context of one camera view. You may independently run an instance of DeepSORT for each of your cameras, that is up to your implementation. If you want to track across different cameras, then that's another task -- you may want to check out person re-identification algorithms and build your own re-id engine.

Thanks, so if I use weights from person re-id and use DeepSORT it's actually not working, am I right?

If you're using person re-id appearance embedder for your deepsort tracking, then I think it should be reasonable for you to to re-use these features from each track for re-identification across different cameras. But do note that in this repo, we use a light re-id network for appearance embedding by design. For person re-id across cameras, people may want to use deeper re-id networks for better discriminative ability. End of the day, it's up to your design considerations.

@hafidh561
Copy link
Author

Thank's for your answers. It's clear to me. I hope you have a great day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants