BackgroundMattingV2 icon indicating copy to clipboard operation
BackgroundMattingV2 copied to clipboard

How can I optimize for CPU

Open bianxg opened this issue 4 years ago • 10 comments

Thanks for your awesome work! I hope to apply it on CPU. How can I optimize it for CPU ? Any suggestions? Thanks.

bianxg avatar Jan 13 '21 10:01 bianxg

Can I optimizing trained model using openvino? Please refer the openvino's limit: https://docs.openvinotoolkit.org/latest/openvino_docs_MO_DG_prepare_model_Supported_Frameworks_Layers.html

bianxg avatar Jan 14 '21 06:01 bianxg

https://docs.openvinotoolkit.org/latest/openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_ONNX.html

bianxg avatar Jan 14 '21 07:01 bianxg

You can give it a try and let me know how it goes.

PeterL1n avatar Jan 14 '21 08:01 PeterL1n

I tried and met a error, please refer https://github.com/openvinotoolkit/openvino/issues/3846

bianxg avatar Jan 14 '21 08:01 bianxg

Please refer the response on openvinotoolkit/openvino#3846 What should the input_shape be? Is [1,3,1080,1920] ok What's difference between the output pha_sm and pha? Thanks.

bianxg avatar Jan 15 '21 01:01 bianxg

The input shape is correct if your image is 1920x1080 resolution.

pha and fgr are the actual output. pha_sm is from the base network (You can refer to the architecture in the original research paper). It is only output for training.

PeterL1n avatar Jan 15 '21 01:01 PeterL1n

There is a challenge to support If. Any ideas? https://github.com/openvinotoolkit/openvino/issues/2406

bianxg avatar Jan 19 '21 09:01 bianxg

The input shape is correct if your image is 1920x1080 resolution.

pha and fgr are the actual output. pha_sm is from the base network (You can refer to the architecture in the original research paper). It is only output for training.

Please refer : https://blog.csdn.net/lhyyhlfornew/article/details/109562383

Can you remove If operator by modifying squeeze() using index method like the blog's method? Or how can I do it? Thanks.

bianxg avatar Jan 19 '21 13:01 bianxg

I see. The only place squeeze() is used is in refiner.py. You can change ref.squeeze(1) in refiner.py to ref[:, 0, :, :]. Then re-export ONNX. This should get rid of the if node.

PeterL1n avatar Jan 19 '21 16:01 PeterL1n

Hi,Does OpenVino accelerate only on Intel CPUs? Does it work for AMD?

972461099 avatar Jan 25 '21 03:01 972461099