[Reprint] python calls its own method to report an error, numpy.ndarray object has no attribute brighten

Reference link: numpy.eye in Python

When using python to write beauty algorithm, a bug appeared, AttributeError:'numpy.ndarray' object has no attribute'brighten'. The brighten method was written by myself and then called. 

    im = cv.imread(src_file, cv.IMREAD_COLOR)

    thin_face=thin_face.thin_face(im,face_point,70)

    big_eye=big_eye.enlarge_eyes(thin_face,face_point,radius=20, strength=10)

    big_eye=big_eye.astype(np.uint8)

 

    new_face_point=read_im_and_landmarks(big_eye)

    new_face_point=read_point(face_point)    

    mouth_mask=get_face_mask(big_eye,face_point[48:61])

    red_mouth=thin_face.brighten(big_eye,mouth_mask,rate=0.7) 

error: 

 

If I replace big_eye with the original image, the model can be called and run through, but it is not the effect I need. After searching for a long time, I also asked the great god, and found that it was caused by irregular naming. Here is a reminder Well, the name of the method I wrote above is thin_face, and the result later is thin_face, which leads to chaotic calls later, so an error is reported, and it needs to be standardized later.

Guess you like

Origin blog.csdn.net/u013946150/article/details/112976717