Skip to content

Commit 3b53c42

Browse files
authored
Use math instead of numpy.math (#3996)
* replace np.math with math * fix wrong-import-order
1 parent cf0b562 commit 3b53c42

File tree

1 file changed

+4
-3
lines changed
  • tools/accuracy_checker/accuracy_checker/preprocessor

1 file changed

+4
-3
lines changed

tools/accuracy_checker/accuracy_checker/preprocessor/crop.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
limitations under the License.
1515
"""
1616

17+
import math
1718
import cv2
1819
import numpy as np
1920
from PIL import Image
@@ -741,9 +742,9 @@ def crop(self, img, center, scale):
741742
height, width = img.shape[:2]
742743
sf = scale * 200.0 / self.dst_width
743744
if sf >= 2:
744-
new_size = int(np.math.floor(max(height, width) / sf))
745-
new_height = int(np.math.floor(height / sf))
746-
new_width = int(np.math.floor(width / sf))
745+
new_size = int(math.floor(max(height, width) / sf))
746+
new_height = int(math.floor(height / sf))
747+
new_width = int(math.floor(width / sf))
747748
if new_size < 2:
748749
return (
749750
np.zeros((self.dst_width, self.dst_height, img.shape[2]), dtype=np.float32) if len(img.shape) > 2

0 commit comments

Comments
 (0)