def find_tags( self ): faces = image.detect_faces( self.path ) # create the tags for ( x, y, w, h ) in faces: tag = Tag( x=x, y=y, width=w, height=h ) self.tags.append( tag ) return self
def debug_tagging( path ): start = time.time() faces = image.detect_faces( path ) end = time.time() im = cv2.imread( path ) for ( x, y, w, h ) in faces: print( "Writing tag", x, y, w, h ) cv2.rectangle( im, ( x, y ), ( x+w, y+h ), 255, 5 ) cv2.imwrite( 'awesome.jpg', im ) print( "\nBenchmark: %d" % (( end - start ) * 1000 ))