TypeError: cannot unpack non-iterable NoneType object #39

Open
opened 2021-07-05 05:20:35 +02:00 by loboere · 3 comments
loboere commented 2021-07-05 05:20:35 +02:00 (Migrated from github.com)

when I use an custom image I get this

-------------- End ----------------
input mean and std: 127.5 127.5
find model: ./insightface_func/models/antelope/glintr100.onnx recognition
find model: ./insightface_func/models/antelope/scrfd_10g_bnkps.onnx detection
set det-size: (640, 640)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-21-c61bb4ca883a> in <module>()
     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)

TypeError: cannot unpack non-iterable NoneType object
when I use an custom image I get this ``` -------------- End ---------------- input mean and std: 127.5 127.5 find model: ./insightface_func/models/antelope/glintr100.onnx recognition find model: ./insightface_func/models/antelope/scrfd_10g_bnkps.onnx detection set det-size: (640, 640) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-21-c61bb4ca883a> in <module>() 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) TypeError: cannot unpack non-iterable NoneType object ```
NNNNAI commented 2021-07-05 05:23:00 +02:00 (Migrated from github.com)

Could you show me your full command line ? Cause i cannot identify which command you are using.Many thanks.

Could you show me your full command line ? Cause i cannot identify which command you are using.Many thanks.
loboere commented 2021-07-05 05:25:08 +02:00 (Migrated from github.com)

is the last cell of the colab
just change iron man for another face

is the last cell of the colab just change iron man for another face
AceSix commented 2021-07-05 05:34:22 +02:00 (Migrated from github.com)

Hello, it seems this error is caused by face detection failure in the source image your provided. You can try to turn down det_thresh in the app.prepare function in the last cell, right after model creation:

app = Face_detect_crop(name='antelope', root='./insightface_func/models')
app.prepare(ctx_id= 0, det_thresh=0.6, det_size=(640,640))

or use another image.

Hello, it seems this error is caused by face detection failure in the source image your provided. You can try to turn down det_thresh in the app.prepare function in the last cell, right after model creation: ~~~ app = Face_detect_crop(name='antelope', root='./insightface_func/models') app.prepare(ctx_id= 0, det_thresh=0.6, det_size=(640,640)) ~~~ or use another image.
Sign in to join this conversation.