Skip to content

How to use pillow_heif in Dataloader (Pytorch) #70

Answered by bigcat88
qilong-zhang asked this question in Q&A
Discussion options

You must be logged in to vote

You can call it before the definition of Dataset_Test class for example.

from multiprocessing import shared_memory
import glob
from pillow_heif import register_heif_opener
import torch

register_heif_opener() 

class Dataset_Test(torch.utils.data.Dataset):  

if it works, you can simplify it even more with one import line and without calling register_heif_opener:

from multiprocessing import shared_memory
import glob
import pillow_heif.HeifImagePlugin  # noqa
import torch

Replies: 2 comments 12 replies

Comment options

You must be logged in to vote
1 reply
@qilong-zhang
Comment options

Comment options

You must be logged in to vote
11 replies
@qilong-zhang
Comment options

@qilong-zhang
Comment options

@bigcat88
Comment options

@qilong-zhang
Comment options

@qilong-zhang
Comment options

Answer selected by qilong-zhang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants