An extension of TorchVision for decoding AVIF and HEIC images.
Assuming torchvision is already installed:
$ pip install torchvision-extra-decoders
Then, you can use the HEIC and AVIF decoders from torchvision like the other decoders (docs):
from torchvision.io import decode_image, decode_heic, decode_avif
img = decode_image("image.heic")
img = decode_image("image.avif")
img = decode_heic("image.heic")
img = decode_avif("image.avif")
This project is released under the LGPL 2.1 License.