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

Support for torchvision.ops.nms on pytorch mobile #2581

Closed
hal-314 opened this issue Aug 12, 2020 · 17 comments
Closed

Support for torchvision.ops.nms on pytorch mobile #2581

hal-314 opened this issue Aug 12, 2020 · 17 comments

Comments

@hal-314
Copy link

hal-314 commented Aug 12, 2020

❓ Questions and Help

You can't deploy object detection models like yolo, FastRCNN, etc without nms op. There are several issues in the forum. https://discuss.pytorch.org/t/support-torchvision-ops-nms-on-mobile-cpu/69627 or in this repo #2050 .

So, there is any eta for this? I want to use YoloV5 to detect objects with a smartphone. I have read the code and it seems to have a fairly straight forward implementation. So, I don't know why Pytorch Mobile can't find this operator.

@fmassa
Copy link
Member

fmassa commented Aug 21, 2020

Assigning this to @dreiss for comments

@chenbohua3
Copy link

chenbohua3 commented Nov 24, 2020

Same issue in pytorch1.6.0 / torchvision 0.7.0. Since nms is a widely used op in detection, this may be an urgent problem:)

@fmassa
Copy link
Member

fmassa commented Nov 27, 2020

FYI we are actively working on getting this working on mobile for the next major release.

@HasnainRaz
Copy link

HasnainRaz commented Jan 22, 2021

@fmassa Any updates regarding this? Scripting a model that uses torchvision nms using pytorch 1.7.1 and torchvision 0.8.2 and running on iOS with Libtorch 1.7.1 still produces the same error.

Is there any update or relevant PR/ticket we can look at to keep track of the progress?

@zhiqwang
Copy link
Contributor

I think that #2897 is aimed to resolve this problem.

@HasnainRaz
Copy link

#2897 appears to track the torchvision ops for android. Is there one that tracks something similar for iOS as well?

@zhiqwang
Copy link
Contributor

zhiqwang commented Jan 22, 2021

Oops... I don't know either.

@fmassa
Copy link
Member

fmassa commented Jan 25, 2021

@HasnainRaz we will also be looking into iOS for next release. We currently don't have an open PR for it yet though.

@fmassa
Copy link
Member

fmassa commented Mar 30, 2021

iOS is supported as of #3582, and Android support has been added in the 0.9.0 release

@fmassa fmassa closed this as completed Mar 30, 2021
@mzkaramat
Copy link

mzkaramat commented Apr 12, 2021

@fmassa, I've tested with compiling libtorch from source and with latest version from cocoapods, but still can't find torchvision::nms in iOS app. Am I missing some step?

@fmassa
Copy link
Member

fmassa commented Apr 12, 2021

@mzkaramat please check #3629 for an end to end example on how to build an iOS app which leverages torchvision::nms via Faster R-CNN

@mzkaramat
Copy link

Thanks!

@elb3k
Copy link

elb3k commented Jun 3, 2021

@mzkaramat please check #3629 for an end to end example on how to build an iOS app which leverages torchvision::nms via Faster R-CNN

Thank you for a solution. But binaries from amazon is not available for x86_64 or even arm64.

@fmassa
Copy link
Member

fmassa commented Jun 4, 2021

@elb3k we will be uploading the stable binaries in the next release.

In the mean time, you can get the nightlies from

https://ossci-ios-build.s3.amazonaws.com/libtorchvision_ops_ios_nightly_build.zip

@elb3k
Copy link

elb3k commented Jun 4, 2021

@elb3k we will be uploading the stable binaries in the next release.

In the mean time, you can get the nightlies from

https://ossci-ios-build.s3.amazonaws.com/libtorchvision_ops_ios_nightly_build.zip

Thank you. I ended up compiling torchvision with LibTorch cocoapads package. Will make pull request with cocoapads build package script.

@fmassa
Copy link
Member

fmassa commented Jun 4, 2021

Hi,

We have some information on how to compile manually in https://github.com/pytorch/vision/blob/master/.circleci/unittest/ios/scripts/binary_ios_build.sh and https://github.com/pytorch/vision/blob/master/ios/build_ios.sh, let us know if further information is required

@elb3k
Copy link

elb3k commented Jun 8, 2021

Hi,

We have some information on how to compile manually in https://github.com/pytorch/vision/blob/master/.circleci/unittest/ios/scripts/binary_ios_build.sh and https://github.com/pytorch/vision/blob/master/ios/build_ios.sh, let us know if further information is required

Hi, these were useful to create LibTorch_vision_ops package on cocoapods. I currently published from fork, once PR is accepted, main repo can publish on cocoapods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants