A
A
andrew462020-06-14 22:33:37
Python
andrew46, 2020-06-14 22:33:37

How to beautifully display the result of a model in pytorch?

Not so long ago I started to master PyTorch and there was such a question. There is a trained model for recognizing numbers from a picture, I load my picture with a number into it in this way:

img = Image.open('./data/9.jpg')
img_t = transform(img)
batch_t = torch.unsqueeze(img_t, 0)

out = model(batch_t)
print(out. shape)

Output: torch.Size([1, 10]) The

question is, how can I deduce to which class the model relates the figure from the picture? Or some value that would definitely make it clear that the model determined the number correctly.
I apologize in advance for the noob question)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question