Person_reID_baseline_pytorch
Person_reID_baseline_pytorch copied to clipboard
demo on images other than dataset
I want to know that how can we use this trained model to predict on real images just like demo.py do it on market 1501 dataset .Suppose I have a person detection module which outputs cropped images of persons after detecting persons from videos of different cameras.Now I want to rank top 10 images of query person on this real image data.
Hi , for the custom dataset, you need to extract the feature first by test.py
and then you could use demo.py
.
Ok,Now we have to add path of our real images(after detection of persons) in --test_dir(--data_dir) for test.py where our real images are stored? and for demo.py we also have to provide path to our real images --test_dir?And the --query_index is also from the same real image dataset? Is that right?
also do the labelling of our real images matters here?
Yes. @TheLeopardsH I suggest you to check the filename and organization in the Market-1501 dataset.
As i am understanding from your perspective is that for my real image data,I have to manage my real data and manage it accordingly market1501 which is manually looking at ids of person and assigning the identities person. But i want something like this case:Suppose I have pool of images of different persons(cropped after person detection) coming in the same directory and I want to query one of image from same pool of images and it gives me correct ranked images of person in query
From your perspective which i maybe understanding it wrongly,each time I have to do everything manually if new persons of different identities comes in cameras but I want everything to be automated
OK. You may need to modify the demo.py
a little bit, especially, for showing images, and only use test.py
to extract the feature.
OK I would work on this.If I face any thing I would let you know.Thank you
results are not showing right
here is what I did.To make things faster,I took images of three different persons from market1501 of my own choice(Folders assigned to different identities:001,002,003(inside them are images of corresponding identity).Dataset is like this
market
->gallery
->001(all images of peson1)
002(all images of person2)
003(all images of person3)
->query
->001(few images of person1)
002 (few images of person2)
003(few images of person3)
When i query image from person3 inside query folder ->003 whose results should correspond to nearly all images of gallery 003 but they are not.
here is the small dataset which i used.Can you tell whats wrong here market.zip
First of all, could you check the features? Are they wrong (for example, all zeros)? Second, you need to check the feature order with the corresponding image order? Do you save a right image name for the feature? Third, please check again with your code.
Cool repo. I'm just jumping on this thread because it's what I would like to do.
If we want to test on our own images, we need to change test.py and demo.py correct?
In test.py, could we just refer to our dataset on line 248 and 249 and format it like the market dataset?
I also don't fully understand how to setup the folders to run inference. Under the pytorch folder in Market, there are query and gallery. Are the features from query being tested against gallery? If I have all the images I would like to test, how would I setup this up to use the prebuild networks using the data structure?
Any help would be greatly appreciated.
If we want to test on our own images, we need to change test.py and demo.py correct?
Yes.
In test.py, could we just refer to our dataset on line 248 and 249 and format it like the market dataset?
Yes. It is the main function to extract the feature.
The test folder should be like:
├── Market/
│ ├── query/ /* query files
│ ├── 001 /* If you do not know the ground-truth, you may put all images in 001
│ ├── xxxx.jpg
│ ├── xxxxx.jpg
│ ├── ...
│ ├── 002
...
│ ├── gallery/ /* gallery files
│ ├── 001 /* If you do not know the ground-truth, you may put all images in 001
│ ├── 002
...
结果没有显示正确 这里是我did.To使事情更快,我花了三个不同的人的图像,从我自己的选择(分配给不同身份的文件夹的market1501:001,002,003(在他们里面是相应的身份的图像).Dataset像这个 市场 ->画廊 -> 001(peson1的所有图像) 002(person2的所有图像) 003(person3的所有图像) ->查询 -> 001(person1的少量图像) 002(person2的少量图像) 003(很少) 当我从查询文件夹-> 003内的person3中查询图像时,其结果应几乎对应于图库003的所有图像,但实际上并非如此。
![]()
I have the same problem as you. Have you solved it now? I have a query file with 20 people in it, and I have a gallery folder. I hope to find the same people in the gallery file for every picture in the query. It's like demo.py Visualization, sort from 1 to 10.Any help will be appreciated