diff --git a/modules/ulab b/modules/ulab index 20f7259a4..a8b25eff3 160000 --- a/modules/ulab +++ b/modules/ulab @@ -1 +1 @@ -Subproject commit 20f7259a471fe180ad64279a6970eb991537cffb +Subproject commit a8b25eff3eea742b949012e512de7c69886e7794 diff --git a/scripts/libraries/ml/ml-core/ml/utils.py b/scripts/libraries/ml/ml-core/ml/utils.py index 19e17bd41..fb2621360 100644 --- a/scripts/libraries/ml/ml-core/ml/utils.py +++ b/scripts/libraries/ml/ml-core/ml/utils.py @@ -38,10 +38,6 @@ def sigmoid(x): return 1.0 / (1.0 + np.exp(-x)) -def mod(a, b): - return a - (b * (a // b)) - - def threshold(scores, threshold, scale, find_max=False, find_max_axis=1): if scale > 0: if find_max: diff --git a/scripts/libraries/ml/ml-darknet/ml/postprocessing/darknet.py b/scripts/libraries/ml/ml-darknet/ml/postprocessing/darknet.py index f9d21e3c2..f81ee42df 100644 --- a/scripts/libraries/ml/ml-darknet/ml/postprocessing/darknet.py +++ b/scripts/libraries/ml/ml-darknet/ml/postprocessing/darknet.py @@ -85,8 +85,8 @@ class YoloV2: # Extract rows, columns, and anchor indices bb_rows = score_indices // (ow * self.anchors_len) - bb_cols = mod(score_indices // self.anchors_len, ow) - bb_anchors = mod(score_indices, self.anchors_len) + bb_cols = (score_indices // self.anchors_len) % ow + bb_anchors = score_indices % self.anchors_len # Get the anchor box information bb_a_array = np.take(self.anchors, bb_anchors, axis=0) diff --git a/scripts/libraries/ml/ml-edgeimpulse/ml/postprocessing/edgeimpulse.py b/scripts/libraries/ml/ml-edgeimpulse/ml/postprocessing/edgeimpulse.py index d2d139b78..612b3222c 100644 --- a/scripts/libraries/ml/ml-edgeimpulse/ml/postprocessing/edgeimpulse.py +++ b/scripts/libraries/ml/ml-edgeimpulse/ml/postprocessing/edgeimpulse.py @@ -64,7 +64,7 @@ class Fomo: # Extract rows and columns bb_rows = score_indices // ow - bb_cols = mod(score_indices, ow) + bb_cols = score_indices % ow # Get the score information bb_scores = np.max(bb[:, _FOMO_CLASSES:], axis=1)