jug is also specially optimized to work with numpy arrays sowhenever your tasks return or receive numpy arraysyou are taking advantage of this optimization jug is another piece of this ecosystem where everything works together we will now look back at computer vision-pattern recognition finding related posts we learned how to compute features on images remember that we were loading image filescomputing featurescombining thesenormalizing themand finally learning how to create classifier we are going to redo that exercise but this time with the use of jug the advantage of this version is that it is now possible to add new feature without having to recompute all of the previous versions we start with few imports as followsfrom jug import taskgenerator now we define the first task generatorthe feature computation@taskgenerator def hfeatures(fname)import mahotas as mh import numpy as np im mh imread(fnameas_grey= im mh stretch(imh mh features haralick(imreturn np hstack([ ptp( ) mean( )]note how we only imported numpy and mahotas inside the function this is small optimizationthis wayonly if the task is run are the modules loaded now we set up the image filenames as followsfilenames glob('dataset/jpg'we can use taskgenerator on any functioneven on the ones that we did not writesuch as numpy arrayimport numpy as np as_array taskgenerator(np arraycompute all featuresfeatures as_array([hfeature(ffor in filenames]get labels as an array as well labels map(label_forfres perform_cross_validation(featureslabels@taskgenerator