Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ The model in Keras is built by the essay author, see [sergiomsilva/alpr-unconstr
</tr>
<tr>
<td> Confidence </td>
<td> 0.9705 </td>
<td> 0.9828 </td>
<td> 0.9987 </td>
<td> 0.9841 </td>
<td> 0.9945 </td>
<td> 0.9979 </td>
</tr>
</table>

Expand Down
Binary file modified docs/sample/annotated/03009.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/sample/annotated/03016.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/sample/annotated/03025.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/sample/warped/03009.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/sample/warped/03016.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/sample/warped/03025.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion wpodnet/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class Predictor:
[1., 1., 1., 1.]
])
_scaling_const = 7.75
_stride = 16

def __init__(self, wpodnet: WPODNet):
self.wpodnet = wpodnet
Expand All @@ -55,11 +56,15 @@ def _resize_to_fixed_ratio(self, image: Image.Image) -> Image.Image:

wh_ratio = max(h, w) / min(h, w)
side = int(wh_ratio * 288)
bound_dim = min(side + side % 16, 608)
bound_dim = min(side + side % self._stride, 608)

factor = bound_dim / min(h, w)
reg_w, reg_h = int(w * factor), int(h * factor)

# Ensure the both width and height are the multiply of `self._stride`
reg_w += self._stride - reg_w % self._stride
reg_h += self._stride - reg_h % self._stride

return image.resize((reg_w, reg_h))

def _to_torch_image(self, image: Image.Image) -> torch.Tensor:
Expand Down