KaiyangZhou / deep-person-reid

Torchreid: Deep learning person re-identification in PyTorch.
https://kaiyangzhou.github.io/deep-person-reid/
MIT License
4.26k stars 1.14k forks source link

mAP using osnet_x1_0 and resnet50 is weird #576

Open a2082761 opened 7 months ago

a2082761 commented 7 months ago

Hello, I just runned Get started code as below using pretrained model 'osnet_x1_0' and even 'resnet50' too. However, the result was weird. mAP was just 3.9%.... and when I used resnet50, it was 2.xx%. How can I increase mAP and can you check my source code which I just want to use pretrained model and I don't want to train dadaset. Thanks.

Results mAP: 3.9% CMC curve Rank-1 : 13.2% Rank-5 : 25.9% Rank-10 : 33.3% Rank-20 : 40.3%

query: 3368

gallery 15913

`import torchreid import torch

datamanager = torchreid.data.ImageDataManager( root="reid-data", sources="market1501", targets="market1501", height=256, width=128, batch_size_train=32, batch_size_test=100, transforms=["random_flip", "random_crop"] )

model = torchreid.models.build_model( name="osnet_x1_0", num_classes=datamanager.num_train_pids, loss="softmax", pretrained=True )

model = model.cuda()

optimizer = torchreid.optim.build_optimizer( model, optim="adam", lr=0.0003 )

scheduler = torchreid.optim.build_lr_scheduler( optimizer, lr_scheduler="single_step", stepsize=20 )

engine = torchreid.engine.ImageSoftmaxEngine( datamanager, model, optimizer=optimizer, scheduler=scheduler, label_smooth=True )

engine.run( save_dir="log/osnet_x1_0", max_epoch=60, eval_freq=10, print_freq=10, test_only=True, visrank=True, visrank_topk=10 )

`

erictan23 commented 5 months ago

I got the same results as you, but i think you could try load other weights to get better mAP image

QiqLiang commented 1 month ago

Hi, I got the same problem when validating my models, have you solved it?