mangye16 / ReID-Survey

Deep Learning for Person Re-identification: A Survey and Outlook
MIT License
626 stars 88 forks source link

pipeline for ReID usage on tracking #6

Closed usamahjundia closed 4 years ago

usamahjundia commented 4 years ago

Hi, firstly i would like to say, thanks for this amazing work.

Im trying to use the agw baseline model as a feature extractor to ReID for deepsort. After adapting the code for my use case, i see that the reid performance during tracking was not as good as a smaller model. Im suspicious that somewhere i messed up the preprocessing / postprocessing.

So if im using the provided pretrained model (to be specific, the market one), is this pipeline correct:

  1. Using BBOX info, crop a patch from an RGB image
  2. resize to input shape 128 x 256
  3. Normalize to [0,1] by dividing by 255
  4. substract the mean[0.485, 0.456, 0.406] and then divide by std [0.229, 0.224, 0.225]
  5. change to NCHW ordering, transform to torch tensor (not important to mention i think)
  6. feed to model, get output
  7. normalize the output by doing output / np.linalg.norm(output,axis=1)
  8. Use euclidian distance for feature distance
mangye16 commented 4 years ago

Hi,

According to your description, the idea of your pre-processing is correct. But the default image loading module for different packages might be different (RGB mode, BGR mode), you may check it again. Or you may use the pytorch tools.

Even so, I cannot guarantee the performance would be better for the tracking. The main reason is that tracking distinguishes the background and the target, while Re-ID tries to discriminate the person appearance. Their target is a little bit different.

usamahjundia commented 4 years ago

Thank you, it's all clear now!