Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Bourne-M committed Mar 25, 2021
2 parents 6e2f516 + 24c4f7c commit a92db19
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
numpy==1.18.4
Pillow==6.2.2
Pillow==7.1.0
tqdm==4.46.0
opencv-python==4.2.0.34
addict==2.2.1
Expand Down
7 changes: 4 additions & 3 deletions torchocr/datasets/RecCollateFn.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ def __call__(self, batch):
for i in range(len(batch)):
_label = batch[i]['label']
labels.append(_label)
img = self.process.width_pad_img(all_same_height_images[i], max_img_w)
img = self.process.normalize_img(img)
img = self.process.normalize_img(all_same_height_images[i])
img = self.process.width_pad_img(img, max_img_w)

img = img.transpose([2, 0, 1])
resize_images.append(torch.tensor(img, dtype=torch.float))
resize_images = torch.stack(resize_images)
Expand All @@ -82,4 +83,4 @@ def __call__(self, batch):
resize_image = self.t(resize_image)
resize_images.append(resize_image)
resize_images = torch.cat([t.unsqueeze(0) for t in resize_images], 0)
return {'img':resize_images,'label':labels}
return {'img':resize_images,'label':labels}

0 comments on commit a92db19

Please sign in to comment.