import opencv package as shownimport cv import numpy as np nowuse the haarcascadeclassifier for detecting faceeye_cascade cv cascadeclassifier(' :/programdata/cascadeclassifier/haarcascade_eye xml'nowfor reading particular imageuse the imread(functionimg cv imread('ab_eye jpg'nowconvert it into grayscale because it would accept grey imagesgray cv cvtcolor(imgcv color_bgr graynow with the help of eye_cascade detectmultiscaleperform actual face detectioneyes eye_cascade detectmultiscale(gray nowdraw rectangle around the whole facefor (ex,ey,ew,ehin eyesimg cv rectangle(img,(ex,ey),(ex+ewey+eh),( , , ), cv imwrite('eye_ab jpg',imgthis python program will create an image named eye_ab jpg with eye detection as shown