fix for bug that occurs when masking torch tensors with numpy array

This commit is contained in:
Corey Hanson
2023-09-14 15:00:11 -04:00
parent 849bba41ad
commit 15c8c8687c
+1 -1
View File
@@ -381,7 +381,7 @@ class QRErrorMasker:
return source_qr, modified_qr
def _create_finder_pattern_mask(self, width, inverted):
mask = np.zeros((width, width), dtype=bool)
mask = torch.zeros((width, width), dtype=torch.bool)
# When borders are trimmed and QR code has module size of 1, results
# are consistent.
finder_coords = [[0, 7, 0, 7], [0, 7, -7, None], [-7, None, 0, 7]]