class_docstr: LVIS PyTorch Object Detection Dataset
class_docstr_tok: ["LVIS","PyTorch","Object","Detection","Dataset"]
code: def _load_img(self, img_dict: "LVISImgEntry"):
      coco_url = img_dict["coco_url"]
      splitted_url = coco_url.split("/")
      img_path = splitted_url[-2] + "/" + splitted_url[-1]
      final_path = self.root / img_path  # <root>/train2017/<img_id>.jpg
      return self.loader(str(final_path))
  
imports: from pathlib import Path
  from typing import Optional, Union, List, Sequence
  import torch
  from PIL import Image
  from torchvision.datasets.folder import default_loader
  from torchvision.transforms import ToTensor
  from typing_extensions import TypedDict
  from avalanche.benchmarks.datasets import DownloadableDataset, default_dataset_location
  from avalanche.benchmarks.datasets.lvis_dataset.lvis_data import lvis_archives
label_desc: Use image node_id 7 for calling the LvisDataset obj's underlying member method code with example usage: obj._load_img(img_dict) and returns: self