Skip to content

Conversation

@guyleaf
Copy link
Contributor

@guyleaf guyleaf commented Sep 1, 2025

This PR fixes PadToSize transform in torchvision >= 0.21.

Related issue: #584

In pytorch/vision#8787 of torchvision 0.21,

  1. the _transform() function of the Transform class was renamed to transform(). The function was referenced from forward function, but since transform was not overridden in PadToSize, a NotImplementedError occurred.
    For backward compatibility of dependencies, _transform() is left in the transform() function.

  2. the _get_params() function of the Transform class was renamed to make_params(). The padding param will not be calculated in PadToSize.
    For backward compatibility of dependencies, _get_params() is left in the make_params() function.

@lyuwenyu lyuwenyu merged commit f9417e3 into lyuwenyu:main Sep 4, 2025
@guyleaf guyleaf deleted the fix/PadToSize_impl_after_torchvision_0_21 branch September 30, 2025 07:03
guyleaf added a commit to guyleaf/RT-DETR that referenced this pull request Oct 15, 2025
* Fix PadToSize impl to follow Transform API after torchvision 0.21 (lyuwenyu#629) (duplicate #5)

* Add update config params for pytorch_v2 all tool scripts (lyuwenyu#633)

---------

Co-authored-by: Marcin Wątroba <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants