As Usman Ali wrote in his comment, pytorch (and most other DL toolboxes) expects a batch of images as an input. Thus you need to call
output = model(data[None, ...])
Inserting a singleton “batch” dimension to your input data
.
Please also note that the model you are using might expect a different input size (3x229x229) and not 3x224x224.