def _load_item(self, item):
    img_desc = self._images[item]
    img_file = path.join(self._img_dir, img_desc['id'])
    if path.exists((img_file + '.png')):
        img_file = (img_file + '.png')
    elif path.exists((img_file + '.jpg')):
        img_file = (img_file + '.jpg')
    else:
        raise IOError('Cannot find any image for id {} in {}'.format(img_desc['id'], self._img_dir))
    img = Image.open(img_file).convert(mode='RGB')
    msk_file = path.join(self._msk_dir, (img_desc['id'] + '.png'))
    msk = [Image.open(msk_file)]
    i = 1
    while path.exists('{}.{}'.format(msk_file, i)):
        msk.append(Image.open('{}.{}'.format(msk_file, i)))
        i += 1
    cat = img_desc['cat']
    iscrowd = img_desc['iscrowd']
    return (img, msk, cat, iscrowd, img_desc['id'])
def _load_item(self, item):
    img_desc = self._images[item]
    img_file = path.join(self._img_dir, img_desc['id'])
    if path.exists((img_file + '.png')):
        img_file = (img_file + '.png')
    elif path.exists((img_file + '.jpg')):
        img_file = (img_file + '.jpg')
    else:
        raise IOError('Cannot find any image for id {} in {}'.format(img_desc['id'], self._img_dir))
    img = Image.open(img_file).convert(mode='RGB')
    msk_file = path.join(self._msk_dir, (img_desc['id'] + '.png'))
    msk = [Image.open(msk_file)]
    i = 1
    while path.exists('{}.{}'.format(msk_file, i)):
        msk.append(Image.open('{}.{}'.format(msk_file, i)))
        i += 1
    cat = img_desc['cat']
    iscrowd = img_desc['iscrowd']
    return (img, msk, cat, iscrowd, img_desc['id'])