I’m not sure, but I think you might create too many threads, which will yield a performance hit.
torchvision.transforms.ToTensor should already use multiple threads and you should see it in the core utilization using e.g. htop.
If I limit the OpenMP threads to 1, I get a speedup, although it’s still slower than just using PyTorch internal functions:
$ python script.py
execution time w threads <function load_image at 0x7f07d032c5f0> 0.026784420013427734
execution time no threads <function load_image at 0x7f07d032c5f0> 0.016533851623535156
execution time w threads <function load_image_w_transfom at 0x7f077147e950> 5.865751266479492
execution time no threads <function load_image_w_transfom at 0x7f077147e950> 3.3059628009796143

$ OMP_NUM_THREADS=1 python script.py
execution time w threads <function load_image at 0x7f84762715f0> 0.031061887741088867
execution time no threads <function load_image at 0x7f84762715f0> 0.013380765914916992
execution time w threads <function load_image_w_transfom at 0x7f84173c3950> 1.241473913192749
execution time no threads <function load_image_w_transfom at 0x7f84173c3950> 3.595093011856079