Skip to content

Commit

Permalink
more compact (#2518)
Browse files Browse the repository at this point in the history
Doesn't add much value in this context
  • Loading branch information
MostHumble authored Aug 7, 2023
1 parent baaf226 commit 1cdb3c3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions beginner_source/data_loading_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@
n = 65
img_name = landmarks_frame.iloc[n, 0]
landmarks = landmarks_frame.iloc[n, 1:]
landmarks = np.asarray(landmarks)
landmarks = landmarks.astype('float').reshape(-1, 2)
landmarks = np.asarray(landmarks, dtype=float).reshape(-1, 2)

print('Image name: {}'.format(img_name))
print('Landmarks shape: {}'.format(landmarks.shape))
Expand Down Expand Up @@ -144,8 +143,7 @@ def __getitem__(self, idx):
self.landmarks_frame.iloc[idx, 0])
image = io.imread(img_name)
landmarks = self.landmarks_frame.iloc[idx, 1:]
landmarks = np.array([landmarks])
landmarks = landmarks.astype('float').reshape(-1, 2)
landmarks = np.array([landmarks], dtype=float).reshape(-1, 2)
sample = {'image': image, 'landmarks': landmarks}

if self.transform:
Expand Down

0 comments on commit 1cdb3c3

Please sign in to comment.