You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-6Lines changed: 12 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,21 +59,27 @@ Example:
59
59
```python
60
60
import torchvision.datasets as dset
61
61
import torchvision.transforms as transforms
62
-
cap = dset.CocoCaptions(root='dir where images are', annFile='json annotation file', transform=transforms.ToTensor())
62
+
cap = dset.CocoCaptions(root='dir where images are',
63
+
annFile='json annotation file',
64
+
transform=transforms.ToTensor())
63
65
64
-
print('Number of samples:', len(cap))
66
+
print('Number of samples:', len(cap))
65
67
img, target = cap[3] # load 4th sample
66
68
67
-
print(img.size())
69
+
print("Image Size: ", img.size())
68
70
print(target)
69
71
```
70
72
71
73
Output:
72
74
73
75
```
74
-
('Number of samples:', 82783)
75
-
(3L, 427L, 640L)
76
-
[u'A plane emitting smoke stream flying over a mountain.', u'A plane darts across a bright blue sky behind a mountain covered in snow', u'A plane leaves a contrail above the snowy mountain top.', u'A mountain that has a plane flying overheard in the distance.', u'A mountain view with a plume of smoke in the background']
76
+
Number of samples: 82783
77
+
Image Size: (3L, 427L, 640L)
78
+
[u'A plane emitting smoke stream flying over a mountain.',
79
+
u'A plane darts across a bright blue sky behind a mountain covered in snow',
80
+
u'A plane leaves a contrail above the snowy mountain top.',
81
+
u'A mountain that has a plane flying overheard in the distance.',
82
+
u'A mountain view with a plume of smoke in the background']
0 commit comments