class_docstr: Decode image data using the given `imagespec`.
  
  The `imagespec` specifies whether the image is decoded
  to numpy/torch/pi, decoded to uint8/float, and decoded
  to l/rgb/rgba:
  
  - l8: numpy uint8 l
  - rgb8: numpy uint8 rgb
  - rgba8: numpy uint8 rgba
  - l: numpy float l
  - rgb: numpy float rgb
  - rgba: numpy float rgba
  - torchl8: torch uint8 l
  - torchrgb8: torch uint8 rgb
  - torchrgba8: torch uint8 rgba
  - torchl: torch float l
  - torchrgb: torch float rgb
  - torch: torch float rgb
  - torchrgba: torch float rgba
  - pill: pil None l
  - pil: pil None rgb
  - pilrgb: pil None rgb
  - pilrgba: pil None rgba
class_docstr_tok: ["Decode","image","data","using","the","given","`","imagespec","`",".","The","`","imagespec","`","specifies","whether","the","image","is","decoded","to","numpy\/torch\/pi",",","decoded","to","uint8\/float",",","and","decoded","to","l\/rgb\/rgba",":","-","l8",":","numpy","uint8","l","-","rgb8",":","numpy","uint8","rgb","-","rgba8",":","numpy","uint8","rgba","-","l",":","numpy","float","l","-","rgb",":","numpy","float","rgb","-","rgba",":","numpy","float","rgba","-","torchl8",":","torch","uint8","l","-","torchrgb8",":","torch","uint8","rgb","-","torchrgba8",":","torch","uint8","rgba","-","torchl",":","torch","float","l","-","torchrgb",":","torch","float","rgb","-","torch",":","torch","float","rgb","-","torchrgba",":","torch","float","rgba","-","pill",":","pil","None","l","-","pil",":","pil","None","rgb","-","pilrgb",":","pil","None","rgb","-","pilrgba",":","pil","None","rgba"]
code: def __init__(self, imagespec):
      assert imagespec in list(
          imagespecs.keys()
      ), f"unknown image specification: {imagespec}"
      self.imagespec = imagespec.lower()
  
imports: import io
  import json
  import os.path
  import pickle
  import tempfile
  import torch
  from torch.utils.data.datapipes.utils.common import StreamWrapper
label_desc: Use image node_id 1 to create a new ImageHandler object  with example: obj = ImageHandler(imagespec)