Skip to content

Commit

Permalink
fix image w<8 error
Browse files Browse the repository at this point in the history
  • Loading branch information
wenlihaoyu authored Jun 26, 2020
1 parent c82915d commit 26a5826
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crnn/network_torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ def predict(self,image):

image = image.view(1,1, *image.size())
image = Variable(image)
if image.size()[-1]<8:
return ''
preds = self(image)
_, preds = preds.max(2)
preds = preds.transpose(1, 0).contiguous().view(-1)
Expand Down Expand Up @@ -197,4 +199,4 @@ def predict_batch(self,boxes,batch_size=1):





0 comments on commit 26a5826

Please sign in to comment.