code: def __call__(
      self,
      input_image,
      value_threshold: float,
      distance_threshold: float,
  ):
      def to(tensor):
          tensor = tensor.to(self.device)
          tensor = tensor.half() if self.use_half else tensor.float()
          return tensor
  
      assert input_image.ndim == 3
      img = input_image
      img_output = np.zeros_like(img)
      try:
          with torch.no_grad():
              lines = pred_lines(
                  img,
                  self.model,
                  to,
                  [img.shape[0], img.shape[1]],
                  value_threshold,
                  distance_threshold,
              )
              for line in lines:
                  x_start, y_start, x_end, y_end = [
                      int(val) for val in line
                  ]
                  cv2.line(
                      img_output,
                      (x_start, y_start),
                      (x_end, y_end),
                      [255, 255, 255],
                      1,
                  )
      except Exception as e:
          pass
      return img_output[:, :, 0]
  
file_path: carefree-learn/cflearn/api/cv/third_party/mlsd/api.py
imports: import os
  import torch
  import numpy
  from .utils import pred_lines
  from .models.mbv2_mlsd_large import MobileV2_MLSD_Large
  from .....misc.toolkit import download_model
label_desc: Use image node_id 3 for calling the MLSDDetector obj's underlying member method code with example usage: obj.__call__(input_image, value_threshold, distance_threshold) and returns: img_output, tensor