docstr: Loads a model from a .pth file containing the model weights.
  
  :param file: The path to the .pth file containing the saved model.
  :type file: str
  :param classes: The list of classes/labels this model was trained
      to predict. Must be in the same order as initially passed to
      :meth:`detecto.core.Model.__init__` for accurate results.
  :type classes: list
  :return: The model loaded from the file.
  :rtype: detecto.core.Model
  
  **Example**::
  
      >>> from detecto.core import Model
  
      >>> model = Model.load('model_weights.pth', ['ant', 'bee'])
docstr_tok: ["Loads","a","model","from","a",".pth","file","containing","the","model","weights",".",":","param","file",":","The","path","to","the",".pth","file","containing","the","saved","model",".",":","type","file",":","str",":","param","classes",":","The","list","of","classes\/labels","this","model","was","trained","to","predict",".","Must","be","in","the","same","order","as","initially","passed","to",":","meth",":","`","detecto.core.Model.__init__","`","for","accurate","results",".",":","type","classes",":","list",":","return",":","The","model","loaded","from","the","file",".",":","rtype",":","detecto.core.Model","*","*","Example","*","*",":",":",">",">",">","from","detecto.core","import","Model",">",">",">","model","=","Model.load","(","'model_weights.pth","'",",","[","'ant","'",",","'bee","'","]",")"]
code: def load(file, classes):
      """Loads a model from a .pth file containing the model weights.
  
      :param file: The path to the .pth file containing the saved model.
      :type file: str
      :param classes: The list of classes/labels this model was trained
          to predict. Must be in the same order as initially passed to
          :meth:`detecto.core.Model.__init__` for accurate results.
      :type classes: list
      :return: The model loaded from the file.
      :rtype: detecto.core.Model
  
      **Example**::
  
          >>> from detecto.core import Model
  
          >>> model = Model.load('model_weights.pth', ['ant', 'bee'])
      """
  
      model = Model(classes)
      model._model.load_state_dict(
          torch.load(file, map_location=model._device)
      )
      return model
  
imports: import os
  import pandas
  import random
  import torch
  import torchvision
  from detecto.config import config
  from detecto.utils import default_transforms, filter_top_predictions, xml_to_csv, _is_iterable, read_image
  from torchvision import transforms
  from torchvision.models.detection.faster_rcnn import FastRCNNPredictor
  from tqdm import tqdm
label_desc: Use image node_id 8 for calling the Model obj's underlying member method code with example usage: obj.load(file, classes) and returns: model