Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9f2fa4a

Browse files
Removed shape loading which fixes a bug with loading AFLW2000 and 300W-LP for training and testing.
1 parent888dc77 commit9f2fa4a

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

‎code/datasets.py‎

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ def __getitem__(self, index):
9696
img=Image.open(os.path.join(self.data_dir,self.X_train[index]+self.img_ext))
9797
img=img.convert(self.image_mode)
9898
mat_path=os.path.join(self.data_dir,self.y_train[index]+self.annot_ext)
99-
shape_path=os.path.join(self.data_dir,self.y_train[index]+'_shape.npy')
10099

101100
# Crop the face loosely
102101
pt2d=utils.get_pt2d_from_mat(mat_path)
@@ -136,11 +135,8 @@ def __getitem__(self, index):
136135
bins=np.array(range(-99,102,3))
137136
binned_pose=np.digitize([yaw,pitch,roll],bins)-1
138137

139-
# Get shape
140-
shape=np.load(shape_path)
141-
142138
# Get target tensors
143-
labels=torch.LongTensor(np.concatenate((binned_pose,shape),axis=0))
139+
labels=binned_pose
144140
cont_labels=torch.FloatTensor([yaw,pitch,roll])
145141

146142
ifself.transformisnotNone:
@@ -171,7 +167,6 @@ def __getitem__(self, index):
171167
img=Image.open(os.path.join(self.data_dir,self.X_train[index]+self.img_ext))
172168
img=img.convert(self.image_mode)
173169
mat_path=os.path.join(self.data_dir,self.y_train[index]+self.annot_ext)
174-
shape_path=os.path.join(self.data_dir,self.y_train[index]+'_shape.npy')
175170

176171
# Crop the face loosely
177172
pt2d=utils.get_pt2d_from_mat(mat_path)
@@ -214,11 +209,8 @@ def __getitem__(self, index):
214209
bins=np.array(range(-99,102,3))
215210
binned_pose=np.digitize([yaw,pitch,roll],bins)-1
216211

217-
# Get shape
218-
shape=np.load(shape_path)
219-
220212
# Get target tensors
221-
labels=torch.LongTensor(np.concatenate((binned_pose,shape),axis=0))
213+
labels=binned_pose
222214
cont_labels=torch.FloatTensor([yaw,pitch,roll])
223215

224216
ifself.transformisnotNone:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp