openvinotoolkit / openvino_notebooks

📚 Jupyter notebook tutorials for OpenVINO™
Apache License 2.0
2.29k stars 789 forks source link

Why not python sample code instead of Colab? #2215

Closed wb666greene closed 3 weeks ago

wb666greene commented 1 month ago

Why not release actual python sample code that we can run? I'm having nothing but trouble with Colab, fail to see any value to it at all!

I got it to run once, using the CPU inference I got: `[W NNPACK.cpp:61] Could not initialize NNPACK! Reason: Unsupported hardware. image 1/1 /home/ai/AI/TestDetection.jpg: 512x640 3 persons, 2 skateboards, 639.9ms Speed: 5.7ms preprocess, 639.9ms inference, 645.8ms postprocess per image at shape (1, 3, 512, 640)

And using the OpenVINO GPU later on: image 1/1 /home/ai/AI/TestDetection.jpg: 640x640 3 persons, 2 skateboards, 42.6ms Speed: 6.0ms preprocess, 42.6ms inference, 3.8ms postprocess per image at shape (1, 3, 640, 640) But when I try to run it a second time with or without doing the CPU inference: det_model.predictor.inference = infer AttributeError: 'NoneType' object has no attribute 'inference' Playing around a bit, it seems that the line: res = det_model('IMAGE_PATH')` Has to be run before the OpenVINO inference can be run successfully, then I can loop and run multiple inferences.

Anyone know how to initialize the YOLO8 so the OpenVINO inference can be run without first doing a non-OpenVINO inference first? Obviously I'm missing something.

So far the Ultralytics docs haven't given me any clues, they seem more toward showing how easy it is to use, (which it is!) instead of explaining how the bits and pieces interact.

I'm pretty impressed with the OpenVINO GPU inference time of ~42 mS on a Celeron N5105 and its integrated UHD graphics.

Wan-Intel commented 1 month ago

OpenVINOâ„¢ Notebooks is a collection of ready-to-run Jupyter notebooks for learning and experimenting with the OpenVINOâ„¢ Toolkit. The notebook provide an introduction to OpenVINOâ„¢ basic and teach developers how to leverage OpenVINOâ„¢ API for optimized deep learning inference.

To run YOLOv8 Intermediate Representation with OpenVINOâ„¢, please refer to Section Instantiate model from Convert and Optimize YOLOv8 real-time object detection with OpenVINOâ„¢. On the other hand, you may refer to Object Detection Python Demo from Open Model Zoo which showcases inference of Object Detection Network using Python.

Wan-Intel commented 3 weeks ago

Closing issue, feel free to re-open or start a new issue if additional assistance is needed.