Skip to content

Commit

Permalink
fix bug: 垂直方向输入序列长度与水平方向不一样
Browse files Browse the repository at this point in the history
  • Loading branch information
yizt committed Aug 9, 2020
1 parent 721700c commit 66eb4a3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,10 @@ def __getitem__(self, item):

target = np.zeros(shape=(self.max_len,), dtype=np.long)
target[:target_len] = indices
input_len = self.im_w // 4 - 3
if self.direction == 'horizontal':
input_len = self.im_w // 4 - 3
else:
input_len = self.im_w // 16 - 1
return image, target, input_len, target_len

def __len__(self):
Expand Down

0 comments on commit 66eb4a3

Please sign in to comment.