Skip to content

[torchvision] Move video utilities to internal fb/io location (#9433) (#9433)#9451

Open
NicolasHug wants to merge 1 commit intopytorch:mainfrom
NicolasHug:export-D95933713
Open

[torchvision] Move video utilities to internal fb/io location (#9433) (#9433)#9451
NicolasHug wants to merge 1 commit intopytorch:mainfrom
NicolasHug:export-D95933713

Conversation

@NicolasHug
Copy link
Member

Summary:
This diff moves the torchvision.io video utilities (read_video, write_video, read_video_timestamps) from the OSS location to the internal fb/io location.

Changes:

  • Created fb/io/video.py with the full implementation of video functions
  • Updated fb/io/init.py to export video functions and internal helpers
  • Updated torchvision/io/init.py to import video functions from fb/io
  • Made torchvision/io/video.py a stub that re-exports from fb/io/video.py
  • Removed video functions from torchvision.io.all (for OSS)
  • The (rare) TorchVision stuff that depended on video decoding utils have been migrated to TorchCodec (that's for TV only, not for the rest of the internal users).

This change ensures:

  • Internal users can continue using 'from torchvision.io import read_video'
  • Internal users importing from torchvision.io.video directly still work
  • No BUCK changes are required
  • OSS/GitHub users will no longer have access to these deprecated video APIs

Eventually we'll want to migrate all these internal users to TorchCodec, but that's for later.

Note: in D95081771 I bluntly removed all the torchvision decoder stuff from both GH and fbcode, but that ended up leading to tons of failed tests (that weren't triggered on the diff!). This new diff is a softer version of that.

Differential Revision: D95933713

Pulled By: NicolasHug

…ch#9433) (pytorch#9433)

Summary:
This diff moves the torchvision.io video utilities (read_video, write_video, read_video_timestamps) from the OSS location to the internal fb/io location.

Changes:
- Created fb/io/video.py with the full implementation of video functions
- Updated fb/io/__init__.py to export video functions and internal helpers
- Updated torchvision/io/__init__.py to import video functions from fb/io
- Made torchvision/io/video.py a stub that re-exports from fb/io/video.py
- Removed video functions from torchvision.io.__all__ (for OSS)
- The (rare) TorchVision stuff that depended on video decoding utils have been migrated to TorchCodec (that's for TV only, not for the rest of the internal users).

This change ensures:
- Internal users can continue using 'from torchvision.io import read_video'
- Internal users importing from torchvision.io.video directly still work
- No BUCK changes are required
- OSS/GitHub users will no longer have access to these deprecated video APIs


Eventually we'll want to migrate all these internal users to TorchCodec, but that's for later.

Note: in D95081771 I bluntly removed all the torchvision decoder stuff from both GH and fbcode, but that ended up leading to tons of failed tests (that weren't triggered on the diff!). This new diff is a softer version of that.

Differential Revision: D95933713

Pulled By: NicolasHug
@pytorch-bot
Copy link

pytorch-bot bot commented Mar 24, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/vision/9451

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 7d78ae8 with merge base d7400a3 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla bot added the cla signed label Mar 24, 2026
@meta-codesync
Copy link

meta-codesync bot commented Mar 24, 2026

@NicolasHug has exported this pull request. If you are a Meta employee, you can view the originating Diff in D95933713.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant