RegNet-Pytorch icon indicating copy to clipboard operation
RegNet-Pytorch copied to clipboard

Can you show a demo of ImageNet model, for using the pretrain model?

Open z-huabao opened this issue 5 years ago • 0 comments

Hello, Thanks for your works! Can you show a demo of using the ImageNet pretrain model?

For example:

# load image
img = cv2.resize(cv2.imread(), (?, ?))
img = (img - ??) / ??
img = img.transpose([2, 0, 1])[None]

# inference
net = regnet_3200M(pretrain=True)
pred = net(torch.from_numpy(img))

# show predict
print(labels[pred.argmax(1)])

z-huabao avatar May 17 '20 03:05 z-huabao