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

Colab Attribute Error #44

Open
diskreet90 opened this issue Jul 7, 2021 · 3 comments
Open

Colab Attribute Error #44

diskreet90 opened this issue Jul 7, 2021 · 3 comments

Comments

@diskreet90
Copy link

Love this project, and the demo project/colab works fine if I don't touch the demo image and the demo video, but as soon as I change either one to test it with my own samples I get an error. Can someone help tell me what I'm doing wrong, or missing?

Here's the output it gives me when it fails.

`AttributeError Traceback (most recent call last)
in ()
23 # img_a = Image.open(pic_a).convert('RGB')
24 img_a_whole = cv2.imread(pic_a)
---> 25 img_a_align_crop, _ = app.get(img_a_whole,crop_size)
26 img_a_align_crop_pil = Image.fromarray(cv2.cvtColor(img_a_align_crop[0],cv2.COLOR_BGR2RGB))
27 img_a = transformer_Arcface(img_a_align_crop_pil)

1 frames
/usr/local/lib/python3.7/dist-packages/insightface/model_zoo/scrfd.py in detect(self, img, threshold, input_size, max_num, metric)
202 input_size = self.input_size if input_size is None else input_size
203
--> 204 im_ratio = float(img.shape[0]) / img.shape[1]
205 model_ratio = float(input_size[1]) / input_size[0]
206 if im_ratio>model_ratio:

AttributeError: 'NoneType' object has no attribute 'shape'`

@woctezuma
Copy link

woctezuma commented Jul 7, 2021

I think the face was not detected. Try lowering the detection threshold #39 or resizing the image deepinsight/insightface#1052.

@NNNNAI
Copy link
Collaborator

NNNNAI commented Jul 9, 2021

I think the face was not detected. Try lowering the detection threshold #39 or resizing the image deepinsight/insightface#1052.

The solution provided by @woctezuma is correct, you can have a try~.Many thanks~.

@g-i-o-r-g-i-o
Copy link

Sometimes it fails on files that worked until an hour before :-)
I've done "factory reset runtime", and now it seems to work (before it gave an error in the first seconds of execution).

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

4 participants