test_performance.py
629 Bytes
__author__ = 'chunk'
import os,sys
from PIL import Image
from ..common import *
def bench_filereading():
timer = Timer()
timer.mark()
for path, subdirs, files in os.walk('/data/hadoop/ImageNet/ILSVRC/ILSVRC2013_DET_val/Train_5000'):
for name in files:
imagepath = os.path.join(path, name)
# print imagepath
img = Image.open(imagepath)
img.save(os.path.join('/data/hadoop/ImageNet/ILSVRC/ILSVRC2013_DET_val/tmp', name), format='JPEG')
timer.report()
"""
performance:
1000:
5000:
read-write:
"""