add *.jpeg support

This commit is contained in:
Glenn Jocher 2019-05-09 11:23:36 +02:00
parent 40bc015b75
commit 1a757524bf
2 changed files with 6 additions and 4 deletions

View File

@ -1,5 +1,5 @@
# pip3 install -U -r requirements.txt
# conda install numpy opencv matplotlib tqdm && conda install pytorch torchvision -c pytorch
# conda install numpy opencv matplotlib tqdm pillow && conda install pytorch torchvision -c pytorch
numpy
opencv-python
torch >= 1.0.0

View File

@ -139,9 +139,11 @@ class LoadImagesAndLabels(Dataset): # for training/testing
assert n > 0, 'No images found in %s' % path
self.img_size = img_size
self.augment = augment
self.label_files = [
x.replace('images', 'labels').replace('.bmp', '.txt').replace('.jpg', '.txt').replace('.png', '.txt')
for x in self.img_files]
self.label_files = [x.replace('images', 'labels').
replace('.jpeg', '.txt').
replace('.jpg', '.txt').
replace('.bmp', '.txt').
replace('.png', '.txt') for x in self.img_files]
# Rectangular Training https://github.com/ultralytics/yolov3/issues/232
self.pad_rectangular = rect