docstr: Load a pretrained model trained with torch-points3d from file.
  return a pretrained model
  Parameters
  ----------
  path: str
      path of a pretrained model
  weight_name: str, optional
      name of the weight
  mock_property: dict, optional
      mock dataset
docstr_tok: ["Load","a","pretrained","model","trained","with","torch-points3d","from","file",".","return","a","pretrained","model","Parameters","--","--","--","--","--","path",":","str","path","of","a","pretrained","model","weight_name",":","str",",","optional","name","of","the","weight","mock_property",":","dict",",","optional","mock","dataset"]
code: def from_file(path, weight_name="latest", mock_property=None):
      """
      Load a pretrained model trained with torch-points3d from file.
      return a pretrained model
      Parameters
      ----------
      path: str
          path of a pretrained model
      weight_name: str, optional
          name of the weight
      mock_property: dict, optional
          mock dataset
  
      """
      weight_name = weight_name if weight_name is not None else "latest"
      path_dir, name = os.path.split(path)
      name = name.split(".")[
          0
      ]  # ModelCheckpoint will add the extension
  
      checkpoint: ModelCheckpoint = ModelCheckpoint(
          path_dir,
          name,
          weight_name if weight_name is not None else "latest",
          resume=False,
      )
      dataset = checkpoint.data_config
  
      if mock_property is not None:
          for k, v in mock_property.items():
              dataset[k] = v
  
      else:
          dataset = instantiate_dataset(checkpoint.data_config)
  
      model: BaseModel = checkpoint.create_model(
          dataset, weight_name=weight_name
      )
      BaseDataset.set_transform(model, checkpoint.data_config)
      return model
  
file_path: torch-points3d/torch_points3d/applications/pretrained_api.py
imports: import os
  import logging
  import urllib.request
  from omegaconf import DictConfig
  from torch_points3d.datasets.dataset_factory import instantiate_dataset
  from torch_points3d.models.model_factory import instantiate_model
  from torch_points3d.models.base_model import BaseModel
  from torch_points3d.datasets.base_dataset import BaseDataset
  from torch_points3d.utils.wandb_utils import Wandb
  from torch_points3d.metrics.model_checkpoint import ModelCheckpoint
label_desc: Use image node_id 2 for calling the PretainedRegistry obj's underlying member method code with example usage: obj.from_file(path, weight_name, mock_property) and returns: model