mirror of
https://github.com/opendatalab/MinerU.git
synced 2026-03-27 11:08:32 +07:00
Compare commits
4 Commits
release-2.
...
release-2.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a0da3029fd | ||
|
|
30fe325428 | ||
|
|
6131013ce9 | ||
|
|
4eddf28c8f |
@@ -256,7 +256,7 @@ class LearnableRepLayer(nn.Module):
|
||||
input_dim = self.in_channels // self.groups
|
||||
kernel_value = torch.zeros(
|
||||
(self.in_channels, input_dim, self.kernel_size, self.kernel_size),
|
||||
dtype=branch.weight.dtype, device=branch.weight.device,
|
||||
dtype=branch.weight.dtype, device=branch.weight.device,
|
||||
)
|
||||
for i in range(self.in_channels):
|
||||
kernel_value[
|
||||
|
||||
@@ -137,7 +137,7 @@ class TextRecognizer(BaseOCRV20):
|
||||
h, w = img.shape[:2]
|
||||
ratio = w / float(h)
|
||||
ratio_imgH = max(math.ceil(imgH * ratio), self.limited_min_width)
|
||||
resized_w = min(imgW,int(ratio_imgH))
|
||||
resized_w = min(imgW, int(ratio_imgH))
|
||||
resized_image = cv2.resize(img, (resized_w, imgH)) /127.5 - 1
|
||||
padding_im = np.zeros((imgC, imgH, imgW), dtype=np.float32)
|
||||
padding_im[:, :, 0:resized_w] = resized_image.transpose((2, 0, 1))
|
||||
|
||||
Reference in New Issue
Block a user