Developers in practice | Intel Developer Kit + OpenVINO? (Anomalib) to build an AI defect detection development environment…

click on the blue word

Follow us to make development more interesting

Author: Wu Zeng, Deng Shumeng Guangdong Rongxu Intelligent Technology Co., Ltd.

Introduction to this article

Many readers are very interested in how to build an Anomalib + OpenVINO? development environment from scratch on the Intel Developer Kit after reading “Rongxu Intelligent Building an Intelligent Optical Character Defect Detection System Based on Anomalib”.

This article will introduce how to build Anomalib + OpenVINO? development environment step by step on Ubuntu22.04 based on Intel Developer Kit.

After getting the Intel Developer Kit, please refer to the official Ubuntu installation documentation to install Ubuntu22.04.

Official website link (copy and open in browser):

https://ubuntu.com/tutorials/install-ubuntu-desktop#1-overview

Development environment construction

After installing Ubuntu22.04, this article will introduce in turn how to install and build the software tools that Anomalib + OpenVINO? development environment depends on, including Anaconda, Git, OpenVINO? Notebooks and VSCode .

With the support of these tools, developers will find that the experience of learning and developing OpenVINO? programs on Linux and Windows is almost exactly the same. Developers who are not familiar with Linux can quickly migrate their development experience on Windows to Linux.

First step

Download and install Anaconda

Anaconda is a very popular Python virtual environment and package management tool, which can easily solve the dependency problems when multiple Python versions coexist and install Python packages, and the user experience is good.

Go to Anaconda official website: https://www.anaconda.com

Download Anaconda3-xxx-Linux-86_64.sh, and then use the command: bash Anaconda3-xxx-Linux-86_64.sh to complete the installation, as shown in Figure 1-1 .

24c13eb89487c84c0833fa1b1e6e6e43.png

Figure 1-1 Download and install Anaconda

Second step

Create and activate a virtual environment

After completing the Anaconda installation and restarting the terminal, it will automatically enter the Anaconda default “base” virtual environment. Use the command: conda create -n ov python=3.10 to create a new virtual environment named “ov” , as shown in Figure 1-2.

dc605f06c038752a87873ceb789fbe0c.png

Figure 1-2 Create a new virtual environment

Then use the command: conda activate ov to activate the newly created virtual environment.

Step 3

Install and start OpenVINO? Notebooks

OpenVINO? Notebooks is a set of executable Jupyter notebooks, which is convenient for developers to learn and use the OpenVINO? tool suite.

Github code warehouse (copy to browser to open):

https://github.com/openvinotoolkit/openvino_notebooks

51b4d7f07177d3b1eb62af72a265d6d8.png

First, install the dependencies of OpenVINO? Notebooks using the command:

sudo apt update
sudo apt upgrade
sudo apt install git
sudo apt install intel-opencl-icd

Swipe right to view the full code

Then, use the command to clone the OpenVINO? Notebooks code warehouse to the local, and install dependencies:

git clone --depth=1 https://github.com/openvinotoolkit/openvino_notebooks.git
cd openvino_notebooks
pip install -r requirements.txt

Swipe right to view the full code

Finally, use the command to start OpenVINO? Notebooks, and then run 002-openvino-api.ipynb, as shown in Figure 1-3. If the hardware information is successfully obtained, it means OpenVINO? Toolkit and OpenVINO? Notebooks installed successfully.

jupyter lab notebooks

d2f23e3289027c408d5683acb4fc0377.png

Figure 1-3 Start OpenVINO? Notebooks

Step 4

Install and configure VS Code

VS Code is an open source code editor developed by Microsoft. It includes built-in debugging support, Git version control, syntax highlighting, code auto-completion and other functions. Through the configuration of various plug-ins, VS Code can be configured as a graphical Python integrated development platform (IDE) under Ubuntu. Use The experience is almost the same as developing Python code with VS Code in Windows.

From the official website of VS Code: https://code.visualstudio.com/

Download the code_xxx.deb installation package, and then complete the installation through the right-click menu → “Open with Software Install”, as shown in Figure 1-4.

9830706ef9920ddc2411347fcfad611f.png

Figure 1-4 Download and install VS Code

Start VS Code, open 002-openvino-api.ipynb, and run the code. If you get the results shown in Figure 1-5, it means that VS Code is installed successfully, and you can write and debug OpenVINO? Python code.

d575a99dd463d0fa87f47d9293a04897.png

Figure 1-5 Running OpenVINO? Python code in VS Code

Step five

Install and learn Anomalib

Anomalib provides a set of notebooks for beginners to get started quickly. Based on this set of notebooks, you can quickly master the usage of Anomalib. Therefore, please clone the Anomalib code warehouse to the local:

git clone https://github.com/openvinotoolkit/anomalib.git

Swipe right to view the full code

ca4dc1f80988b5311e21d8f13670a525.png

Then, use the command to complete the installation of anomalib:

pip install anomalib

Finally, in VS Code, open 001_getting_started.ipynb in Anomalib notebooks to start learning how to use Anomalib.

ebeeeb45a07b45fe02929ebd55f128ba.png

Summary

This article introduces in detail the whole process of building an Anomalib + OpenVINO? development environment from scratch on the Intel Developer Kit. With the help of the sample programs of OpenVINO? Notebooks and Anomalib Notebooks, you can Quickly learn the use of OpenVINO? and Anomalib. If you have further needs, please feel free to contact me.

Guangdong Rongxu Intelligent Technology Co., Ltd. official website:

https://www.gdrosmart.com/

–END–

You may want to know (click the blue word to view) OpenVINO? DevCon 2023 is back! Intel stimulates the infinite potential of developers with innovative products 5th Anniversary Update | OpenVINO? 2023.0, making AI deployment and acceleration easier The highlight of OpenVINO? 5th Anniversary! The 2023.0 version continues to upgrade AI deployment and acceleration performance OpenVINO? 2023.0 actual combat | Deploy YOLOv8 object detection model in LabVIEW Developer actual combat series resource packs are here!  Draw with AI, wish her a happy holiday; three simple steps, OpenVINO? Help you easily experience AIGC
 Don't know how to draw with OpenVINO Click for tutorial.  A few lines of code easily realize real-time reasoning for PaddleOCR, come get it!  Use OpenVINO to quickly realize high-performance artificial intelligence reasoning in "device-edge-cloud" Extracting text from pictures is amazing? Try to achieve OCR in three steps! 【Notebook Series Issue 6】Based on the Pytorch pre-training model to achieve semantic segmentation tasks Use OpenVINO? preprocessing API to further improve YOLOv5 reasoning performance
Scan the QR code below to experience it immediately
OpenVINO? Toolkit 2023.0

Click to read the original text and experience OpenVINO 2023.0 now

4671540127528682fdde9ba68c8eb2c1.png

The article is so wonderful, are you “reading” it?