|
|
|
@ -35,7 +35,6 @@ import itertools
|
|
|
|
|
import functools
|
|
|
|
|
from .common import download
|
|
|
|
|
import tarfile
|
|
|
|
|
import scipy.io as scio
|
|
|
|
|
from paddle.dataset.image import *
|
|
|
|
|
from paddle.reader import map_readers, xmap_readers
|
|
|
|
|
from paddle import compat as cpt
|
|
|
|
@ -45,6 +44,7 @@ import numpy as np
|
|
|
|
|
from multiprocessing import cpu_count
|
|
|
|
|
import six
|
|
|
|
|
from six.moves import cPickle as pickle
|
|
|
|
|
from paddle.utils import try_import
|
|
|
|
|
__all__ = ['train', 'test', 'valid']
|
|
|
|
|
|
|
|
|
|
DATA_URL = 'http://paddlemodels.bj.bcebos.com/flowers/102flowers.tgz'
|
|
|
|
@ -108,8 +108,11 @@ def reader_creator(data_file,
|
|
|
|
|
:return: data reader
|
|
|
|
|
:rtype: callable
|
|
|
|
|
'''
|
|
|
|
|
scio = try_import('scipy.io')
|
|
|
|
|
|
|
|
|
|
labels = scio.loadmat(label_file)['labels'][0]
|
|
|
|
|
indexes = scio.loadmat(setid_file)[dataset_name][0]
|
|
|
|
|
|
|
|
|
|
img2label = {}
|
|
|
|
|
for i in indexes:
|
|
|
|
|
img = "jpg/image_%05d.jpg" % i
|
|
|
|
|