Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.
6430 Discussions

Coding issue with sample at https://docs.openvino.ai/2023.0/notebooks/230-yolov8-optimization-with-o

MikeVMWEdge
Beginner
462 Views

Hello, this sample has a method defined called "post_process" which takes the results of a prediction or segmentation and formats the output.   It leverages a module from ultralytics called ops:

 

from ultralytics.yolo.utils import ops

 

and expects a method ops.scale_segments.  It appears that this function does not exist and searching finds no results for it.  

 

---> 62         segments = [ops.scale_segments(input_hw, x, shape, normalize=False) for x in ops.masks2segments(masks)]
     63     results.append({"det": pred[:, :6].numpy(), "segment": segments})
     64 return results

AttributeError: module 'ultralytics.yolo.utils.ops' has no attribute 'scale_segments'
 
 
I am looking for tips how to refactor this code to achieve the same results and remove reference to the missing method.   I am new to both ultralytics and openvino.  Any tips?  
 
This should probably be treated as a bug with https://github.com/openvinotoolkit/openvino_notebooks/blob/main/notebooks/230-yolov8-optimization/230-yolov8-optimization.ipynb.  I will log an issue on the repo too.
0 Kudos
2 Replies
Iffa_Intel
Moderator
426 Views

Hi,

 

I don't see that issue from my end. I'm running the code with the function call (scale_segments) using Jupter Notebook on my local machine.

 

This is my library declaration:

Iffa_Intel_0-1689299598387.png

 

scale_segments function call (it's in the if & else statement of data postprocessing

 

highlight.png

Test on single image:

Iffa_Intel_2-1689300199383.png

 

Make sure you had set up and installed the requirements properly according to your OS/env.
You may refer here.

 

Cordially,

Iffa

 

 

 

 

 

0 Kudos
Iffa_Intel
Moderator
373 Views

Hi,


Intel will no longer monitor this thread since we have provided a solution. If you need any additional information from Intel, please submit a new question. 



Cordially,

Iffa


0 Kudos
Reply