|
|
|
@ -54,30 +54,3 @@ sys.exit(0)
|
|
|
|
|
# print ("Grid size {0}x{1} (cols x rows)".format(cols, rows))
|
|
|
|
|
# print (" (total size:", cols*imsize, rows*imsize, "margins:", mx, my, ")")
|
|
|
|
|
#################
|
|
|
|
|
|
|
|
|
|
for l in range(7):
|
|
|
|
|
print (LABELS[l])
|
|
|
|
|
col = 0
|
|
|
|
|
row = 0
|
|
|
|
|
with open(args.labels) as f:
|
|
|
|
|
f.readline()
|
|
|
|
|
for line in f:
|
|
|
|
|
path, label = line.split(",")
|
|
|
|
|
label = int(label)
|
|
|
|
|
if label == l:
|
|
|
|
|
image = Image.open(path)
|
|
|
|
|
print (image.size)
|
|
|
|
|
|
|
|
|
|
x = mx + (col*imsize)
|
|
|
|
|
y = my + imsize + (7-l)*(4*imsize) - ((row+1)*imsize)
|
|
|
|
|
|
|
|
|
|
c.drawInlineImage(image, x, y, width=imsize, height=imsize)
|
|
|
|
|
col += 1
|
|
|
|
|
if col >= cols:
|
|
|
|
|
col = 0
|
|
|
|
|
row +=1
|
|
|
|
|
if row >= 3:
|
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
c.showPage()
|
|
|
|
|
c.save()
|