__init__.py 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. # In fbcode, import from the fb-only location
  2. # For OSS, these imports would fail (video_reader not available)
  3. try:
  4. from pytorch.vision.fb.io import ( # type: ignore[import-not-found]
  5. _HAS_CPU_VIDEO_DECODER,
  6. _HAS_VIDEO_OPT,
  7. _probe_video_from_file,
  8. _probe_video_from_memory,
  9. _read_video_from_file,
  10. _read_video_from_memory,
  11. _read_video_timestamps_from_file,
  12. _read_video_timestamps_from_memory,
  13. _video_opt,
  14. Timebase,
  15. VideoMetaData,
  16. VideoReader,
  17. )
  18. except ImportError:
  19. pass
  20. from .image import (
  21. decode_avif,
  22. decode_gif,
  23. decode_heic,
  24. decode_image,
  25. decode_jpeg,
  26. decode_png,
  27. decode_webp,
  28. encode_jpeg,
  29. encode_png,
  30. ImageReadMode,
  31. read_file,
  32. read_image,
  33. write_file,
  34. write_jpeg,
  35. write_png,
  36. )
  37. __all__ = [
  38. "ImageReadMode",
  39. "decode_image",
  40. "decode_jpeg",
  41. "decode_png",
  42. "decode_avif",
  43. "decode_heic",
  44. "decode_webp",
  45. "decode_gif",
  46. "encode_jpeg",
  47. "encode_png",
  48. "read_file",
  49. "read_image",
  50. "write_file",
  51. "write_jpeg",
  52. "write_png",
  53. ]