Hi!
I have used this code:
while True:
start = time()
frame = cam.capture()
frame = transforms.ToTensor()(frame)
frame = frame.unsqueeze(0)
frame = frame.to(DEVICE)
print(frame.shape)
out = net(frame)
print(time() - start)
And have this time:
0.009600400924682617
torch.Size([1, 3, 224, 224])
0.010586738586425781
torch.Size([1, 3, 224, 224])
0.011191129684448242
torch.Size([1, 3, 224, 224])
0.3026876449584961
torch.Size([1, 3, 224, 224])
0.4999411106109619
torch.Size([1, 3, 224, 224])
0.5003457069396973
torch.Size([1, 3, 224, 224])
0.49947404861450195
Why model began to work slower?