updates
This commit is contained in:
parent
bb1e551150
commit
9c227dd2b4
|
@ -36,4 +36,4 @@ paste <(awk "{print \"$PWD\"}" <trainvalno5k.part) trainvalno5k.part | tr -d '\t
|
||||||
# sudo rm -rf train_images/._*
|
# sudo rm -rf train_images/._*
|
||||||
# lastly convert each .tif to a .bmp for faster loading in cv2
|
# lastly convert each .tif to a .bmp for faster loading in cv2
|
||||||
|
|
||||||
# /home/glenn_jocher3/coco/images/train2014/COCO_train2014_000000167126.jpg # bad image??
|
# ./coco/images/train2014/COCO_train2014_000000167126.jpg # corrupted image
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
# pip3 install -U -r requirements.txt
|
# pip3 install -U -r requirements.txt
|
||||||
# conda install numpy opencv matplotlib tqdm pillow && conda install pytorch torchvision -c pytorch
|
# conda install numpy opencv matplotlib tqdm pillow
|
||||||
|
# conda install pytorch torchvision -c pytorch
|
||||||
|
# conda install -c conda-forge scikit-image
|
||||||
numpy
|
numpy
|
||||||
opencv-python
|
opencv-python
|
||||||
torch >= 1.1.0
|
torch >= 1.1.0
|
||||||
|
|
|
@ -223,6 +223,16 @@ class LoadImagesAndLabels(Dataset): # for training/testing
|
||||||
pass # print('Warning: missing labels for %s' % self.img_files[i]) # missing label file
|
pass # print('Warning: missing labels for %s' % self.img_files[i]) # missing label file
|
||||||
assert len(np.concatenate(self.labels, 0)) > 0, 'No labels found. Incorrect label paths provided.'
|
assert len(np.concatenate(self.labels, 0)) > 0, 'No labels found. Incorrect label paths provided.'
|
||||||
|
|
||||||
|
# Detect corrupted images https://medium.com/joelthchao/programmatically-detect-corrupted-image-8c1b2006c3d3
|
||||||
|
detect_corrupted_images = False
|
||||||
|
if detect_corrupted_images:
|
||||||
|
from skimage import io # conda install -c conda-forge scikit-image
|
||||||
|
for file in tqdm(self.img_files, desc='Detecting corrupted images'):
|
||||||
|
try:
|
||||||
|
_ = io.imread(file)
|
||||||
|
except:
|
||||||
|
print('Corrupted image detected: %s' % file)
|
||||||
|
|
||||||
def __len__(self):
|
def __len__(self):
|
||||||
return len(self.img_files)
|
return len(self.img_files)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue