code: def predict_image(image, model_name):
      image = Image.fromarray(np.uint8(image)).convert("RGB")
  
      model_path = "./models/" + model_name
  
      if model_name == "DeiT":
          model = VisionClassifierInference(
              feature_extractor=DeiTFeatureExtractor.from_pretrained(
                  model_path
              ),
              model=DeiTForImageClassification.from_pretrained(
                  model_path
              ),
          )
  
      else:
          model = TorchVisionClassifierInference(model_path=model_path)
  
      pred = model.predict_image(img=image, return_str=False)
  
      for key in pred.keys():
          pred[key] = pred[key] / 100
  
      return pred
  
imports: import gradio
  import numpy
  from PIL import Image
  from transformers import DeiTFeatureExtractor, DeiTForImageClassification
  from hugsvision.inference.VisionClassifierInference import VisionClassifierInference
  from hugsvision.inference.TorchVisionClassifierInference import TorchVisionClassifierInference
label_desc: Use image node_id 1 for calling a global function with example usage: predict_image(image, model_name) and returns: pred