What does torchvision.datasets.CocoCaptions can do?
Downloading coco datasets or just loading coco datasets in my local files.
My code as follows:
cap = datasets.CocoCaptions(root = './Images',
                            annFile = '.Annotations/anno.json',
                            transform=transforms.ToTensor())

print('Number of samples: ', len(cap))
img, target = cap[3] # load 4th sample

print("Image Size: ", img.size())
print(target)`

But it throw error : JSONDecodeError: Expecting value: line 1 column 1 (char 0)