Skip to content

Commit 95071c5

Browse files
committed
Skip broken images in avatars/ folder
1 parent 782450a commit 95071c5

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

afy/cam_fomm.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ def load_images(IMG_SIZE = 256):
7474
for i, f in enumerate(images_list):
7575
if f.endswith('.jpg') or f.endswith('.jpeg') or f.endswith('.png'):
7676
img = cv2.imread(f)
77+
if img is None:
78+
log("Failed to open image: {}".format(f))
79+
continue
80+
7781
if img.ndim == 2:
7882
img = np.tile(img[..., None], [1, 1, 3])
7983
img = img[..., :3][..., ::-1]

0 commit comments

Comments
 (0)