text_plain_output_1.png
import torchvision.datasets as dset

import torchvision.transforms as transforms

import torchvision
import torchvision.datasets as dset
import torchvision.transforms as transforms
from torchvision.models.detection.faster_rcnn import FastRCNNPredictor
path2data = '/kaggle/input/levi9-hack9-2023/train'
path2json = '/kaggle/input/levi9-hack9-2023/train.json'

coco_train = dset.CocoDetection(root=path2data, annFile=path2json, transform=transforms.ToTensor())

img, target = coco_train[0]
print(img.size)
print(target)