Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'list' object has no attribute 'kps' #2723

Open
DeepthiSudharsan opened this issue Jan 27, 2025 · 0 comments
Open

AttributeError: 'list' object has no attribute 'kps' #2723

DeepthiSudharsan opened this issue Jan 27, 2025 · 0 comments

Comments

@DeepthiSudharsan
Copy link

DeepthiSudharsan commented Jan 27, 2025

Below is the code I was trying to run and the error I got:

import numpy as np
import os
import glob
import cv2
from PIL import Image

import insightface
from insightface.app import FaceAnalysis
from insightface.data import get_image as ins_get_image

app = FaceAnalysis(name="buffalo_l")
app.prepare(ctx_id=0, det_size=(640,640))
img = cv2.imread("friends.png")
rob = cv2.imread("rob.png")
faces = app.get(img)
rob_faces = app.get(rob)
swapper = insightface.model_zoo.get_model('../inswapper_128.onnx',download=False,download_zip=False)
res = img.copy()
for face in faces:
    res = swapper.get(res,faces,rob_faces,paste_back=True)

Facing the below issue, while running the above code:

Error:

aimg, M = face_align.norm_crop2(img, target_face.kps, self.input_size[0])
AttributeError: 'list' object has no attribute 'kps'

Any help on this regard would be greatly appreciated. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant