Skip to content
This repository has been archived by the owner on Aug 19, 2023. It is now read-only.

case RGBA in images from custom dataset #186

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions retinanet/dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@ def load_image(self, image_index):
if len(img.shape) == 2:
img = skimage.color.gray2rgb(img)

#case RGBA read image
elif img.shape[2] == 4:
img = skimage.color.rgba2rgb(img)

return img.astype(np.float32)/255.0

def load_annotations(self, image_index):
Expand Down