Skip to content

Commit 353500d

Browse files
authored
Merge pull request #2 from ravi9/2023.1.0
Update to 2023.1.0
2 parents 33a80b9 + 4d7780c commit 353500d

File tree

4 files changed

+32
-44
lines changed

4 files changed

+32
-44
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
# scripts
2-
Install scripts for Intel tools and sdks
1+
# OpenVINO AMI Setup
2+
3+
This repo contains scripts to install OpenVINO notebooks in AWS using EC2 Builder.

install-ov-notebooks.sh

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,28 @@
11
#!/bin/bash
22

3-
# Script to install following on Amazon Linux 2 EC2 instance
4-
# Intel OpenVINO (DEV) and its dependencies,
5-
# Jupyter Lab
6-
# Install OpenVINO_Notebooks https://github.com/openvinotoolkit/openvino_notebooks
3+
# Script to install OpenVINO_Notebooks on Amazon Linux 2023 based EC2 instance
4+
# OpenVINO_Notebooks: https://github.com/openvinotoolkit/openvino_notebooks
75

86
# Install dependencies
97
sudo yum -y update &&
108
sudo yum -y upgrade &&
119
sudo yum -y groupinstall "Development Tools" &&
12-
sudo yum install -y python3 python3-devel.x86_64 mesa-libGL
13-
14-
sudo ln -s /usr/bin/pip3 /usr/bin/pip
15-
16-
pip install --upgrade pip
17-
18-
pip install jupyterlab ipywidgets virtualenv
10+
sudo yum install -y git-all mesa-libGL
1911

12+
# Create Python Virtual Env and install OV Notebooks
2013
cd /home/ec2-user
14+
source /home/ec2-user/.bashrc
15+
python3 -m venv openvino_env
16+
source openvino_env/bin/activate
17+
export PATH=/home/ec2-user/openvino_env/bin:/home/ec2-user/.local/bin:/home/ec2-user/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:$PATH
2118
git clone --depth=1 https://github.com/openvinotoolkit/openvino_notebooks.git
2219
cd openvino_notebooks
2320

24-
pip install -r requirements.txt
25-
26-
# Install specific version of OPENCV
27-
OPENCV_VER=4.5.5.64
28-
pip install -U opencv-python-headless==$OPENCV_VER opencv-python==$OPENCV_VER
21+
# Install OpenVINO Notebook dependencies.
22+
/home/ec2-user/openvino_env/bin/pip install -r requirements.txt
2923

3024
# Name the ipython kernel to OpenVINO
31-
/usr/bin/python3 -m ipykernel install --user --name OpenVINO
25+
/home/ec2-user/openvino_env/bin/python -m ipykernel install --user --name OpenVINO
3226

3327
# Download scripts to start Jupyter
3428
curl https://raw.githubusercontent.com/psakamoori/scripts/main/start_jupyter.sh -o /home/ec2-user/.start_jupyter.sh

start_jupyter.sh

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,20 @@ curl -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-da
1010
# Setup the ec2-user environment
1111
cd /home/ec2-user
1212
source /home/ec2-user/.bashrc
13-
export PATH=/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/ec2-user/.local/bin:/home/ec2-user/bin:$PATH
14-
13+
source /home/ec2-user/openvino_env/bin/activate
14+
export PATH=/home/ec2-user/openvino_env/bin:/home/ec2-user/.local/bin:/home/ec2-user/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:$PATH
1515
export TF_ENABLE_ONEDNN_OPTS=1
1616

1717
# Start Jupyter Notebook server with $INSTANCE_ID as the password
18-
/home/ec2-user/.local/bin/jupyter lab --no-browser --NotebookApp.allow_password_change=False --NotebookApp.token="$INSTANCE_ID" --ip 0.0.0.0 --port 8888 >/tmp/jupyter.log 2>&1 &
18+
cd /home/ec2-user/openvino_notebooks
19+
20+
/home/ec2-user/.local/bin/jupyter lab \
21+
--no-browser \
22+
--NotebookApp.allow_password_change=False \
23+
--NotebookApp.token="$INSTANCE_ID" \
24+
--ip 0.0.0.0 \
25+
--port 8888 &
26+
27+
# For debugging
28+
#--port 8888 >/tmp/jupyter.log 2>&1 &
29+

test-pip-ov-install.sh

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,12 @@
11
#!/bin/bash
22

3-
# Test script which tests: omz_downloader, omz_converter, benchmark_app, mo, OpenVINO Python imports.
3+
# Test script which tests: OpenVINO Python imports.
44

55
# Path where all the pip-installed OpenVINO binaries
6-
BIN_PREFIX=/home/ec2-user/.local/bin/
7-
8-
# Download googlenet-v1-tf model from OpenVINO Model Zoo (OMZ)
9-
$BIN_PREFIX/omz_downloader --name googlenet-v1-tf
10-
11-
# Convert googlenet-v1-tf model to OpenVINO IR
12-
$BIN_PREFIX/omz_converter --name googlenet-v1-tf
13-
14-
# Benchmark googlenet-v1-tf model with OpenVINO Benchmark App...¶
15-
$BIN_PREFIX/benchmark_app -m public/googlenet-v1-tf/FP32/googlenet-v1-tf.xml -niter 1
16-
17-
# Test with model optimizer
18-
$BIN_PREFIX/mo \
19-
--framework=tf \
20-
--data_type FP32 \
21-
--output_dir ./public/googlenet-v1-tf/FP32 \
22-
--model_name=googlenet-v1-tf \
23-
--input_shape=[1,224,224,3] \
24-
--input_model ./public/googlenet-v1-tf/inception_v1.frozen.pb
6+
BIN_PREFIX=/home/ec2-user/openvino_env/bin/
257

268
## Test Python Imports
279

28-
python3 -c "from openvino.inference_engine import IENetwork, IECore, get_version as get_ov_version; print('openvino version: ' + get_ov_version())"
10+
$BIN_PREFIX/python -c "import openvino as ov; print('OpenVINO Version: ' + ov.runtime.get_version())"
2911

30-
python3 -c "from openvino.tools.benchmark.main import main"
12+
$BIN_PREFIX/python -c "from openvino.tools.benchmark.main import main"

0 commit comments

Comments
 (0)