1.
conda install PIL
from PIL import Image, ImageDraw, ImageFont
im = Image.open( data_root + lin.strip().split('\t')[0] )
draw = ImageDraw.Draw(im)
ttfront = ImageFont.truetype('simsun.ttc', 64)
draw.text((10, 10), car_style_rear[label], fill=(255,0,0), font=ttfront)
im.save( save_root + file_name)
2.
import matplotlib.pyplot as plt
plt.figure(i)
plt.imshow(img)
plt.axis('off')
plt.text(100, 100, car_style_rearx[label], color='red')
plt.savefig(save_root + file_name)
plt.imsave(save_root + file_name[:-4] + u'___' + car_style_rear[label] + u'.jpg', img)
-------------------------------reference--------------
1. http://www.thinksaas.cn/topics/0/671/671920.html