code: def __init__(self, device: torch.device):
      if cv2 is None:
          raise ValueError("`cv2` is needed for `MLSDdetector`")
      model_path = download_model("mlsd_large_512_fp32")
      model = MobileV2_MLSD_Large()
      model.load_state_dict(torch.load(model_path), strict=True)
      self.model = model.to(device).eval()
      self.device = device
      self.use_half = False
  
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 1 to create a new MLSDDetector object  with example: obj = MLSDDetector(device)