class_docstr: 读取解析PASCAL VOC2007/2012数据集
class_docstr_tok: ["\u8bfb\u53d6\u89e3\u6790PASCAL","VOC2007\/2012\u6570\u636e\u96c6"]
code: def collate_fn(batch):
      images, targets = tuple(zip(*batch))
      # images = torch.stack(images, dim=0)
      #
      # boxes = []
      # labels = []
      # img_id = []
      # for t in targets:
      #     boxes.append(t['boxes'])
      #     labels.append(t['labels'])
      #     img_id.append(t["image_id"])
      # targets = {"boxes": torch.stack(boxes, dim=0),
      #            "labels": torch.stack(labels, dim=0),
      #            "image_id": torch.as_tensor(img_id)}
  
      return images, targets
  
file_path: deep-learning-for-image-processing/pytorch_object_detection/ssd/my_dataset.py
imports: from torch.utils.data import Dataset
  import os
  import torch
  import json
  from PIL import Image
  from lxml import etree
label_desc: Use image node_id 7 for calling the VOCDataSet obj's underlying member method code with example usage: obj.collate_fn(batch) and returns: images,  targets