Skip to content
Merged
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
7 changes: 4 additions & 3 deletions tools/accuracy_checker/accuracy_checker/preprocessor/crop.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
limitations under the License.
"""

import math
import cv2
import numpy as np
from PIL import Image
Expand Down Expand Up @@ -741,9 +742,9 @@ def crop(self, img, center, scale):
height, width = img.shape[:2]
sf = scale * 200.0 / self.dst_width
if sf >= 2:
new_size = int(np.math.floor(max(height, width) / sf))
new_height = int(np.math.floor(height / sf))
new_width = int(np.math.floor(width / sf))
new_size = int(math.floor(max(height, width) / sf))
new_height = int(math.floor(height / sf))
new_width = int(math.floor(width / sf))
if new_size < 2:
return (
np.zeros((self.dst_width, self.dst_height, img.shape[2]), dtype=np.float32) if len(img.shape) > 2
Expand Down