whileTrue:# Capture frame-by-frameret,frame=cap.read()frame=cv2.flip(frame,1)# Our operations on the frame come heregray=cv2.cvtColor(frame,cv2.COLOR_BGR2GRAY)faces=detector(gray)# Counter to count number of facesi=0forfaceinfaces:x,y=face.left(),face.top()x1,y1=face.right(),face.bottom()cv2.rectangle(frame,(x,y),(x1,y1),(0,255,0),2)# Increment the iterartor each time you get the coordinatesi=i+1# Adding face number to the box detecting facescv2.putText(frame,'face num'+str(i),(x-10,y-10),cv2.FONT_HERSHEY_SIMPLEX,0.7,(0,0,255),2)print(face,i)# Display the resulting framecv2.imshow('frame',frame)