code: def loader_process(q_in, q_out, X: Tensor):
      while (_recv := q_in.get()) is not None:
          idx, fn = _recv
          img = Image.open(fn)
          img = img.convert("RGB") if img.mode != "RGB" else img
  
          # eval: 76.08%, load in 0m7.366s (0m5.301s with simd)
          # sudo apt-get install libjpeg-dev
          # CC="cc -mavx2" pip install -U --force-reinstall pillow-simd
          rescale = min(img.size) / 256
          crop_left = (img.width - 224 * rescale) / 2.0
          crop_top = (img.height - 224 * rescale) / 2.0
          img = img.resize(
              (224, 224),
              Image.BILINEAR,
              box=(
                  crop_left,
                  crop_top,
                  crop_left + 224 * rescale,
                  crop_top + 224 * rescale,
              ),
          )
  
          # broken out
          # img_tensor = Tensor(img.tobytes(), device='CPU')
          # storage_tensor = X[idx].contiguous().realize().lazydata.realized
          # storage_tensor._copyin(img_tensor.numpy())
  
          # faster
          X[idx].contiguous().realize().lazydata.realized.as_buffer(
              force_zero_copy=True
          )[:] = img.tobytes()
  
          # ideal
          # X[idx].assign(img.tobytes())   # NOTE: this is slow!
          q_out.put(idx)
  
file_path: tinygrad/examples/mlperf/dataloader.py
imports: import random, time, ctypes, struct
  import numpy
  from PIL import Image
  from tqdm import tqdm
  import pickle
  from tinygrad import dtypes, Tensor
  from tinygrad.helpers import getenv, prod, Timing
  from multiprocessing import Queue, Process, shared_memory, connection, Lock
label_desc: Use image node_id 2 for calling a global function with example usage: loader_process(q_in, q_out, X) without return types