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

Skip to content

Commit 1cdb3c3

Browse files
authored
more compact (#2518)
Doesn't add much value in this context
1 parent baaf226 commit 1cdb3c3

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

beginner_source/data_loading_tutorial.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@
6868
n = 65
6969
img_name = landmarks_frame.iloc[n, 0]
7070
landmarks = landmarks_frame.iloc[n, 1:]
71-
landmarks = np.asarray(landmarks)
72-
landmarks = landmarks.astype('float').reshape(-1, 2)
71+
landmarks = np.asarray(landmarks, dtype=float).reshape(-1, 2)
7372

7473
print('Image name: {}'.format(img_name))
7574
print('Landmarks shape: {}'.format(landmarks.shape))
@@ -144,8 +143,7 @@ def __getitem__(self, idx):
144143
self.landmarks_frame.iloc[idx, 0])
145144
image = io.imread(img_name)
146145
landmarks = self.landmarks_frame.iloc[idx, 1:]
147-
landmarks = np.array([landmarks])
148-
landmarks = landmarks.astype('float').reshape(-1, 2)
146+
landmarks = np.array([landmarks], dtype=float).reshape(-1, 2)
149147
sample = {'image': image, 'landmarks': landmarks}
150148

151149
if self.transform:

0 commit comments

Comments
 (0)