Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0ccfbf0

Browse files
authored
Update data_loading_tutorial.py (#1773)
Duplicate of #802.
1 parent 6d0f524 commit 0ccfbf0

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

beginner_source/data_loading_tutorial.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@
5959
# 0805personali01.jpg,27,83,27,98, ... 84,134
6060
# 1084239450_e76e00b7e7.jpg,70,236,71,257, ... ,128,312
6161
#
62-
# Let's quickly read the CSV and get the annotations in an (N, 2) array where N
63-
# is the number of landmarks.
62+
# Let's take a single image name and its annotations from the CSV, in this case row index number 65
63+
# for person-7.jpg just as an example. Read it, store the image name in ``img_name`` and store its
64+
# annotations in an (L, 2) array ``landmarks`` where L is the number of landmarks in that row.
6465
#
6566

6667
landmarks_frame = pd.read_csv('data/faces/face_landmarks.csv')
@@ -402,6 +403,10 @@ def show_landmarks_batch(sample_batched):
402403

403404
plt.title('Batch from dataloader')
404405

406+
# if you are using Windows, uncomment the next line and indent the for loop.
407+
# you might need to go back and change "num_workers" to 0.
408+
409+
# if __name__ == '__main__':
405410
for i_batch, sample_batched in enumerate(dataloader):
406411
print(i_batch, sample_batched['image'].size(),
407412
sample_batched['landmarks'].size())

0 commit comments

Comments
 (0)