Not an issue: changing det-dize / processing speed #65

Open
opened 2021-07-24 13:59:02 +02:00 by instant-high · 9 comments
instant-high commented 2021-07-24 13:59:02 +02:00 (Migrated from github.com)

I've been playing around with the line

app.prepare(ctx_id= 0, det_thresh=opt.det_thresh, det_size=(640, 640))

in test_video_swapsingle.py

Setting lower values (480, 320, 256, 160) significant increases the processing speed
Setting to 256 doubles #it/sec.

It nearly always gives the same results, depending on video resolution and size of the face in the video frame.
eg. if your video is 720p height and the face is someting like 256pixel height in it you can use det-size 256 and it is working.

But arcface throws a lot of warnings for every frame:
[W:onnxruntime:, execution_frame.cc:721 onnxruntime::ExecutionFrame::VerifyOutputSizes] Expected shape from model of {12800,10} does not match actual shape of {3200,10} for output 454

Can this be done a better way?

I've been playing around with the line _app.prepare(ctx_id= 0, det_thresh=opt.det_thresh, det_size=(640, 640))_ in _test_video_swapsingle.py_ Setting lower values (480, 320, 256, 160) significant increases the processing speed Setting to 256 doubles #it/sec. It nearly always gives the same results, depending on video resolution and size of the face in the video frame. eg. if your video is 720p height and the face is someting like 256pixel height in it you can use det-size 256 and it is working. But arcface throws a lot of warnings for every frame: _[W:onnxruntime:, execution_frame.cc:721 onnxruntime::ExecutionFrame::VerifyOutputSizes] Expected shape from model of {12800,10} does not match actual shape of {3200,10} for output 454_ Can this be done a better way?
NNNNAI commented 2021-07-24 15:17:51 +02:00 (Migrated from github.com)

Maybe you can try 320*320. And I thought you can go to insightface to ask the author, cause I just use it as a tool to detect face Hhhh.

Maybe you can try 320*320. And I thought you can go to insightface to ask the author, cause I just use it as a tool to detect face Hhhh.
instant-high commented 2021-07-24 15:36:15 +02:00 (Migrated from github.com)

Yes. You have to use all other values as a pair (640,640 or 320,320 or.....)
Searched the net so far but couldn't find more information so I asked

Yes. You have to use all other values as a pair (640,640 or 320,320 or.....) Searched the net so far but couldn't find more information so I asked
NNNNAI commented 2021-07-24 15:38:24 +02:00 (Migrated from github.com)

You can create a issue right here insightface, they should be professional enough to solve your problem.

You can create a issue right here [insightface](https://github.com/deepinsight/insightface), they should be professional enough to solve your problem.
nttstar commented 2021-07-25 09:20:00 +02:00 (Migrated from github.com)

You can call onnxruntime.set_default_logger_severity(3) to avoid warning.

You can call `onnxruntime.set_default_logger_severity(3)` to avoid warning.
instant-high commented 2021-07-25 09:46:01 +02:00 (Migrated from github.com)

Thank you. That works.

Thank you. That works.
coldplayer12 commented 2021-07-29 20:09:34 +02:00 (Migrated from github.com)

I've been playing around with the line

app.prepare(ctx_id= 0, det_thresh=opt.det_thresh, det_size=(640, 640))

in test_video_swapsingle.py

Setting lower values (480, 320, 256, 160) significant increases the processing speed
Setting to 256 doubles #it/sec.

It nearly always gives the same results, depending on video resolution and size of the face in the video frame.
eg. if your video is 720p height and the face is someting like 256pixel height in it you can use det-size 256 and it is working.

But arcface throws a lot of warnings for every frame:
[W:onnxruntime:, execution_frame.cc:721 onnxruntime::ExecutionFrame::VerifyOutputSizes] Expected shape from model of {12800,10} does not match actual shape of {3200,10} for output 454

Can this be done a better way?

Excuse me but, in which file do you find that value? I'm modifying "face_detect_crop_single.py" but it doesn't change the resolution or the det size. Thanks!

> > > I've been playing around with the line > > _app.prepare(ctx_id= 0, det_thresh=opt.det_thresh, det_size=(640, 640))_ > > in _test_video_swapsingle.py_ > > Setting lower values (480, 320, 256, 160) significant increases the processing speed > Setting to 256 doubles #it/sec. > > It nearly always gives the same results, depending on video resolution and size of the face in the video frame. > eg. if your video is 720p height and the face is someting like 256pixel height in it you can use det-size 256 and it is working. > > But arcface throws a lot of warnings for every frame: > _[W:onnxruntime:, execution_frame.cc:721 onnxruntime::ExecutionFrame::VerifyOutputSizes] Expected shape from model of {12800,10} does not match actual shape of {3200,10} for output 454_ > > Can this be done a better way? Excuse me but, in which file do you find that value? I'm modifying "face_detect_crop_single.py" but it doesn't change the resolution or the det size. Thanks!
instant-high commented 2021-07-29 20:13:24 +02:00 (Migrated from github.com)

As described above.
Change value in test_video_swapsingle.py

As described above. Change value in test_video_swapsingle.py
aesanchezgh commented 2022-02-13 17:11:55 +01:00 (Migrated from github.com)

As described above. Change value in test_video_swapsingle.py

So I tried changing from 640 to 320, but still only seeing 1 it/s. My graphics card is a Titan V.

> As described above. Change value in test_video_swapsingle.py So I tried changing from 640 to 320, but still only seeing 1 it/s. My graphics card is a Titan V.
vladosShikos commented 2022-02-18 02:49:29 +01:00 (Migrated from github.com)

Got lost trying to figure out where to call it from, can anybody help?

I've only managed to find an import of set_default_logger_severity function in onnxruntime/init.py, but so far I was unable to pinpoint where are the calls to onnxruntime.

Turned out, putting set_default_logger_severity(3) into onnxruntime/init.py works totally fine: warnings're gone.

> Got lost trying to figure out where to call it from, can anybody help? I've only managed to find an import of set_default_logger_severity function in onnxruntime/__init__.py, but so far I was unable to pinpoint where are the calls to onnxruntime. Turned out, putting set_default_logger_severity(3) into onnxruntime/__init__.py works totally fine: warnings're gone.
Sign in to join this conversation.