if __name__ == '__main__': from io import mplayer, view import sys from time import time if len(sys.argv) > 1: fn = sys.argv[1] else: fn = 'test.avi -vf scale=640:480 -benchmark' sys.setcheckinterval(2**30) try: import pypyjit pypyjit.set_param(trace_limit=200000) except ImportError: pass start = start0 = time() for fcnt, img in enumerate(mplayer(Image, fn)): #view(img) view(sobel_magnitude(img)) #view(sobel_magnitude_generator(img)) #sobel_magnitude_generator(img) #sobel_magnitude(img) print 1.0 / (time() - start), 'fps, ', (fcnt - 2) / ( time() - start0), 'average fps' start = time() if fcnt == 2: start0 = time()
return b if __name__ == '__main__': from io import mplayer, view import sys from time import time if len(sys.argv) > 1: fn = sys.argv[1] else: fn = 'test.avi -vf scale=640:480 -benchmark' sys.setcheckinterval(2**30) try: import pypyjit pypyjit.set_param(trace_limit=200000) except ImportError: pass start = start0 = time() for fcnt, img in enumerate(mplayer(Image, fn)): #view(img) view(sobel_magnitude(img)) #view(sobel_magnitude_generator(img)) #sobel_magnitude_generator(img) #sobel_magnitude(img) print 1.0 / (time() - start), 'fps, ', (fcnt-2) / (time() - start0), 'average fps' start = time() if fcnt==2: start0 = time()
from time import time if len(sys.argv) > 1: fn = sys.argv[1] else: fn = 'test.avi -vf scale=640:480 -benchmark' sys.setcheckinterval(2**30) try: import pypyjit pypyjit.set_param(trace_limit=200000) except ImportError: pass start = start0 = time() for fcnt, img in enumerate(mplayer(NoBorderImagePadded, fn)): #view(img) #sobeldx(img) #view(uint8(sobel_magnitude(img))) #sobel_magnitude_uint8(img) try: view(sobel_magnitude_uint8(img)) except IOError, e: if e.errno != errno.EPIPE: raise print 'Exiting' break print 1.0 / (time() - start), 'fps, ', (fcnt-2) / (time() - start0), 'average fps' start = time() if fcnt==2:
from time import time if len(sys.argv) > 1: fn = sys.argv[1] else: fn = 'test.avi -vf scale=640:480 -benchmark' sys.setcheckinterval(2**30) try: import pypyjit pypyjit.set_param(trace_limit=200000) except ImportError: pass start = start0 = time() for fcnt, img in enumerate(mplayer(NoBorderImagePadded, fn)): #view(img) #sobeldx(img) #view(uint8(sobel_magnitude(img))) #sobel_magnitude_uint8(img) try: view(sobel_magnitude_uint8(img)) except IOError, e: if e.errno != errno.EPIPE: raise print 'Exiting' break print 1.0 / (time() - start), 'fps, ', (fcnt - 2) / ( time() - start0), 'average fps' start = time()
from noborder import NoBorderImage from io import mplayer, view for img in mplayer(NoBorderImage, 'test.avi'): view(img)