def PrepareDataList(BASE, length):
List = []
for M in range(0,min(length,len(BASE))):
img, text = BASE[M]
image = misc.imread(img,mode='RGB')
#image = misc.imresize(image, [227, 227])
r1 = []
if isfile(text):
f = open(text, 'r')
s = f.readline()
st = s.split(' ')
for i in range(0,2):
r1.append(int(st[i]))
f.close()
else: #If there are no txt file - "no bird situation"
r1.append(0);
r1.append(0);
List.append([image,r1])
return List
# Random test and train list
评论列表
文章目录