zhiqwang / yolort

yolort is a runtime stack for yolov5 on specialized accelerators such as tensorrt, libtorch, onnxruntime, tvm and ncnn.
https://zhiqwang.com/yolort
GNU General Public License v3.0
708 stars 153 forks source link

Remove `NestedTensor` from pre-processing #471

Open zhiqwang opened 1 year ago

zhiqwang commented 1 year ago

Anyway the error suggests that the issue could be resolved by moving NestedTestor to a pytorch class, if it works would you accept a PR on that?

Originally posted by @gillpeacegood in https://github.com/zhiqwang/yolov5-rt-stack/discussions/469#discussioncomment-4468135

Actually there are some historical reasons for the existence of NestedTensor, which is not required since #293 was merged. I guess there's some way to not rely upon NestedTensor for the pre-processing.

https://github.com/zhiqwang/yolov5-rt-stack/blob/1043ee3eacd8218c39e324c39693e373daf29a09/yolort/models/transform.py#L13-L20