Train.py could only train .png images, but not .jpg images

I am using jetson-inference/python/training/classification/train.py to train my model.

In the training images, there are .png and .jpg images.

I just found that the .jpg images was not trained.

Is there a quick way to make the .jpg be train with .png images?

Thank you.

Hi,

jetson-inference uses torchvision for loading image data.

Based on the document below, torchvision should support both .jpg and .png file extension:
https://github.com/pytorch/vision/blob/master/torchvision/datasets/folder.py#L234

IMG_EXTENSIONS = ('.jpg', '.jpeg', '.png', '.ppm', '.bmp', '.pgm', '.tif', '.tiff', '.webp')

Could you validate if the data is stored in the recommended placement first:
https://pytorch.org/vision/stable/datasets.html

root/dog/xxx.png
root/dog/xxy.png
root/dog/[...]/xxz.png

root/cat/123.png
root/cat/nsdf3.png
root/cat/[...]/asd932_.png

Thanks.

thank you @AastaLLL for your quickly response.
for now I converted .jpg files to .png.
I just found that maybe just because I made a mistake when detecting the images. :P
Let me check further. :)

Sure. Thanks for the update !