deepinsight / deepinsight/insightface

AttributeError: 'NoneType' object has no attribute 'reshape'

Open
#2,452 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
29.7k
Forks
6.1k
PR merge metrics
No merged PRs in 30d

Description

I running the inswapper_main.py demo,but it's error :
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[6], line 27
25 res = img.copy()
26 for face in faces:
---> 27 res = swapper.get(res, face, source_face, paste_back=True)
28 cv2.imwrite("mabaoguo.jpg", res)
29 res = []

File e:\ProgramData\anaconda3\envs\bilibili\lib\site-packages\insightface\model_zoo\inswapper.py:50, in INSwapper.get(self, img, target_face, source_face, paste_back)
47 aimg, M = face_align.norm_crop2(img, target_face.kps, self.input_size[0])
48 blob = cv2.dnn.blobFromImage(aimg, 1.0 / self.input_std, self.input_size,
49 (self.input_mean, self.input_mean, self.input_mean), swapRB=True)
---> 50 latent = source_face.normed_embedding.reshape((1,-1))
51 latent = np.dot(latent, self.emap)
52 latent /= np.linalg.norm(latent)

AttributeError: 'NoneType' object has no attribute 'reshape'

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.