[torchlib] Migrate torchvision implementations#2569
Conversation
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2569 +/- ##
==========================================
+ Coverage 70.11% 70.18% +0.07%
==========================================
Files 228 228
Lines 27396 27421 +25
Branches 2785 2786 +1
==========================================
+ Hits 19208 19245 +37
+ Misses 7228 7217 -11
+ Partials 960 959 -1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Pull Request Overview
This PR migrates torchvision implementations by adding support for roi_align and roi_pool operations to the torch_lib vision module. The changes enable ONNX export compatibility for these computer vision operations commonly used in object detection models.
- Adds
torchvision::roi_alignimplementation with proper coordinate transformation and sampling ratio handling - Adds
torchvision::roi_poolimplementation using ONNX MaxRoiPool operator - Updates existing
torchvision::nmsoperation to be trace-only
|
Where do we migrate this from? Was there a test we can move to here as well? |
|
Adapted from https://github.com/pytorch/vision/blob/main/torchvision/ops/_register_onnx_ops.py. There are some tests we can move over too |
Adapted from https://github.com/pytorch/vision/blob/main/torchvision/ops/_register_onnx_ops.py. Also migrated tests.