I’m doing a project with pytorch and I need to get a single image and pass to my CNN.
I already have the code working to get the image from my webcam. My CNN is trained and now I need to pass my image to the CNN.
Is that possible with some custom Dataset? Anyone has some tip to give me about that?
Usually, you just take the image )say as numpy array from OpenCV), convert to a tensor and unsqueeze the batch dimension. You need to apply the same transformations, for OpenCV you might also have to shuffle the channels BGR->RGB.