Skip to content

Commit

Permalink
validate
Browse files Browse the repository at this point in the history
  • Loading branch information
Wovchena committed Sep 13, 2023
1 parent 3e3a6a8 commit b1ae86e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions model_api/python/openvino/model_api/models/yolo.py
Original file line number Diff line number Diff line change
Expand Up @@ -834,11 +834,13 @@ def postprocess(self, outputs, meta):
if 1 != len(outputs):
self.raise_error("expect 1 output")
prediction = next(iter(outputs.values()))
if np.float32 != prediction.dtype:
self.raise_error("the output must be of precision f32")
out_shape = prediction.shape
if 3 != len(out_shape):
raise RuntimeError("expect the output of rank 3")
raise RuntimeError("the output must be of rank 3")
if 1 != out_shape[0]:
raise RuntimeError("expect 1 as the first dim of the output")
raise RuntimeError("the first dim of the output must be 1")
boxes = non_max_suppression(
prediction, self.confidence_threshold, self.iou_threshold
)
Expand Down Expand Up @@ -882,5 +884,4 @@ def postprocess(self, outputs, meta):

class YOLOv8(YOLOv5):
"""YOLOv5 and YOLOv8 are identical in terms of inference"""

__model__ = "YOLOv8"

0 comments on commit b1ae86e

Please sign in to comment.