diff --git a/training_data/to_npy.py b/training_data/to_npy.py index ca4f892..b848b77 100644 --- a/training_data/to_npy.py +++ b/training_data/to_npy.py @@ -16,6 +16,9 @@ for path in paths: #img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) #x.append(img) temp = Image.open(path) + #remove alpha channel + if temp.mode=='RGBA': + temp = im.convert('RGB') keep = temp.copy() keep = np.array(keep) x.append(keep)