1. Installed the Pytorch framework for deep-learning person re-identification - Link
2. Followed the steps commenting out the GPU code and ran it on CPU
3. Code to Check Available Models
4. Running it on Other Datasets
5. Next Step - On Custom Dataset Setting up, Testing Models
Happy Mastering DL!!!
2. Followed the steps commenting out the GPU code and ran it on CPU
3. Code to Check Available Models
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from torchreid import models | |
print(models.show_avai_models()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torchreid | |
datamanager = torchreid.data.ImageDataManager( | |
root='reid-data', | |
sources='market1501', | |
height=256, | |
width=128, | |
batch_size=32, | |
market1501_500k=False) | |
model = torchreid.models.build_model( | |
name = 'resnet50', | |
num_classes = datamanager.num_train_pids, | |
loss='softmax', | |
pretrained=True) | |
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/resnet50', | |
max_epoch=60, | |
eval_freq=10, | |
print_freq=10, | |
test_only=False) |
5. Next Step - On Custom Dataset Setting up, Testing Models
Happy Mastering DL!!!
No comments:
Post a Comment