forked from TexasInstruments/edgeai-tidl-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
fadil
authored and
Kumar Desappan
committed
Mar 2, 2023
1 parent
61e8f52
commit 206352a
Showing
41 changed files
with
1,356 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# J721E Setup | ||
- [J721E Setup](#j721e-setups) | ||
- [Introduction](#introduction) | ||
- [Setup](#setup) | ||
- [Copying the libraries](#copying-the-libraries) | ||
|
||
|
||
|
||
## Introduction | ||
|
||
- This folder have instructions on how to setup J721E by downloading and installing required dependencies. | ||
|
||
|
||
## Setup | ||
- On the target run the following. This will download and install required python and system dependencies. | ||
``` | ||
cd edgeai-tidl-tools/dockers//J721E/PSDKRA | ||
./setup.sh | ||
``` | ||
- The script will display a list of shell variables need to be exported in the end. Set these env vars in your shell. | ||
|
||
## Running the examples | ||
- Run the python model compile on PC [Model Compilation on PC](../../../examples/osrt_python/README.md#model-compilation-on-pc) | ||
- Run the python examples on target [Run Inference on Target](../../../examples/osrt_python/README.md#model-inference-on-evm) | ||
- Compile the CPP application by following instruction from [Compile CPP examples](../../../examples/osrt_cpp/README.md#setup) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
#!/bin/bash | ||
|
||
SCRIPTDIR=`pwd` | ||
cd $HOME | ||
if [ ! -d required_libs ];then | ||
mkdir required_libs | ||
fi | ||
export SOC=j7 | ||
REL=08_06_00_00 | ||
|
||
if [ ! -d arago_j7_pywhl ];then | ||
mkdir arago_j7_pywhl | ||
fi | ||
cd arago_j7_pywhl | ||
STR=`pip3 list | grep dlr` | ||
SUB='dlr' | ||
|
||
if [[ "$STR" != *"$SUB"* ]]; then | ||
wget --quiet --proxy off https://software-dl.ti.com/jacinto7/esd/tidl-tools/$REL/OSRT_TOOLS/ARM_LINUX/ARAGO//dlr-1.10.0-py3-none-any.whl | ||
yes | pip3 install --upgrade --force-reinstall dlr-1.10.0-py3-none-any.whl | ||
fi | ||
STR=`pip3 list | grep onnxruntime-tidl` | ||
SUB='onnxruntime-tidl' | ||
if [[ "$STR" != *"$SUB"* ]]; then | ||
wget --quiet --proxy off https://software-dl.ti.com/jacinto7/esd/tidl-tools/$REL/OSRT_TOOLS/ARM_LINUX/ARAGO//onnxruntime_tidl-1.7.0-cp38-cp38-linux_aarch64.whl | ||
yes | pip3 install onnxruntime_tidl-1.7.0-cp38-cp38-linux_aarch64.whl | ||
fi | ||
STR=`pip3 list | grep tflite-runtime` | ||
SUB='tflite-runtime' | ||
if [[ "$STR" != *"$SUB"* ]]; then | ||
wget --quiet --proxy off https://software-dl.ti.com/jacinto7/esd/tidl-tools/$REL/OSRT_TOOLS/ARM_LINUX/ARAGO//tflite_runtime-2.8.2-cp38-cp38-linux_aarch64.whl | ||
yes | pip3 install --upgrade --force-reinstall tflite_runtime-2.8.2-cp38-cp38-linux_aarch64.whl | ||
# to sync with tensor flow build version | ||
y | pip3 uninstall numpy | ||
yes | pip3 install numpy | ||
fi | ||
|
||
cd $HOME | ||
rm -r arago_j7_pywhl | ||
if [ ! -d /usr/include/tensorflow ];then | ||
wget --quiet --proxy off https://software-dl.ti.com/jacinto7/esd/tidl-tools/$REL/OSRT_TOOLS/ARM_LINUX/ARAGO//tflite_2.8_aragoj7.tar.gz | ||
tar xf tflite_2.8_aragoj7.tar.gz | ||
rm tflite_2.8_aragoj7.tar.gz | ||
mv tflite_2.8_aragoj7/tensorflow /usr/include | ||
mv tflite_2.8_aragoj7/tflite_2.8 /usr/lib/ | ||
cp tflite_2.8_aragoj7/libtensorflow-lite.a $HOME/required_libs/ | ||
rm -r tflite_2.8_aragoj7 | ||
cd $HOME | ||
else | ||
echo "skipping tensorflow setup: found /usr/include/tensorflow" | ||
echo "To redo the setup delete: /usr/include/tensorflow and run this script again" | ||
fi | ||
|
||
|
||
if [ ! -d /usr/include/onnxruntime ];then | ||
wget --quiet --proxy off https://software-dl.ti.com/jacinto7/esd/tidl-tools/$REL/OSRT_TOOLS/ARM_LINUX/ARAGO//onnx_1.7.0_aragoj7.tar.gz | ||
tar xf onnx_1.7.0_aragoj7.tar.gz | ||
rm onnx_1.7.0_aragoj7.tar.gz | ||
cp -r onnx_1.7.0_aragoj7/libonnxruntime.so $HOME/required_libs/ | ||
mv onnx_1.7.0_aragoj7/onnxruntime /usr/include/ | ||
rm -r onnx_1.7.0_aragoj7 | ||
cd $HOME | ||
else | ||
echo "skipping onnxruntime setup: found /usr/include/onnxruntime" | ||
echo "To redo the setup delete: /usr/include/onnxruntime and run this script again" | ||
fi | ||
|
||
if [ ! -d /usr/include/neo-ai-dlr ];then | ||
wget --quiet --proxy off https://software-dl.ti.com/jacinto7/esd/tidl-tools/$REL/OSRT_TOOLS/ARM_LINUX/ARAGO//dlr_1.10.0_aragoj7.tar.gz | ||
tar xf dlr_1.10.0_aragoj7.tar.gz | ||
rm dlr_1.10.0_aragoj7.tar.gz | ||
cd dlr_1.10.0_aragoj7 | ||
unzip dlr-1.10.0-py3-none-any.whl | ||
cp ./dlr/libdlr.so $HOME/required_libs/ | ||
cd - | ||
mv dlr_1.10.0_aragoj7/neo-ai-dlr /usr/include/ | ||
rm -r dlr_1.10.0_aragoj7 | ||
cd $HOME | ||
else | ||
echo "skipping neo-ai-dlr setup: found /usr/include/neo-ai-dlr" | ||
echo "To redo the setup delete: /usr/include/neo-ai-dlr and run this script again" | ||
fi | ||
|
||
if [ ! -f /usr/include/itidl_rt.h ];then | ||
wget --quiet --proxy off https://software-dl.ti.com/jacinto7/esd/tidl-tools/$REL/TIDL_TOOLS/AM68PA/tidl_tools.tar.gz | ||
tar xf tidl_tools.tar.gz | ||
rm tidl_tools.tar.gz | ||
cp tidl_tools/itidl_rt.h /usr/include/ | ||
cp tidl_tools/itvm_rt.h /usr/include/ | ||
cd $HOME | ||
else | ||
echo "skipping itidl_rt.h setup: found /usr/include/itidl_rt.h" | ||
echo "To redo the setup delete: /usr/include/itidl_rt.h and run this script again" | ||
fi | ||
|
||
if [ -d ~/required_libs ];then | ||
cp -r ~/required_libs/* /usr/lib/ | ||
fi | ||
|
||
if [ ! -f /usr/dlr/libdlr.so ];then | ||
mkdir /usr/dlr | ||
cp ~/required_libs/libdlr.so /usr/dlr/ | ||
fi | ||
|
||
if [ ! -f /usr/lib/libonnxruntime.so.1.7.0 ];then | ||
ln -s /usr/lib/libonnxruntime.so /usr/lib/libonnxruntime.so.1.7.0 | ||
fi | ||
#Cleanup | ||
cd $HOME | ||
rm -rf required_libs | ||
rm -rf tidl_tools | ||
|
||
echo "export the following vars" | ||
echo "export SOC=j7" | ||
echo "export TIDL_TOOLS_PATH=" | ||
echo "export LD_LIBRARY_PATH=/usr/lib" | ||
cd $SCRIPTDIR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# Copyright (C) 2021 Texas Instruments Incorporated - http://www.ti.com/ | ||
# | ||
# Redistribution and use in source and binary forms, with or without | ||
# modification, are permitted provided that the following conditions | ||
# are met: | ||
# | ||
# Redistributions of source code must retain the above copyright | ||
# notice, this list of conditions and the following disclaimer. | ||
# | ||
# Redistributions in binary form must reproduce the above copyright | ||
# notice, this list of conditions and the following disclaimer in the | ||
# documentation and/or other materials provided with the | ||
# distribution. | ||
# | ||
# Neither the name of Texas Instruments Incorporated nor the names of | ||
# its contributors may be used to endorse or promote products derived | ||
# from this software without specific prior written permission. | ||
# | ||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
||
|
||
ARG REPO_LOCATION='arm64v8' | ||
FROM ${REPO_LOCATION}ubuntu:18.04 as edgeai_tidl_tools_u18 | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
ARG NPROC=1 | ||
ARG PROJECT_NAME=edgeai_tidl_tools_u18 | ||
ENV USE_PROXY=ti | ||
|
||
# Setup proxy settings | ||
ADD entrypoint.sh setup_proxy.sh /usr/bin/ | ||
RUN /usr/bin/setup_proxy.sh | ||
|
||
RUN apt-get update -y && apt-get dist-upgrade -y && apt-get install -y \ | ||
glib-2.0-dev \ | ||
ncurses-dev | ||
|
||
RUN apt-get install -y \ | ||
build-essential \ | ||
cmake \ | ||
git \ | ||
wget \ | ||
unzip \ | ||
pkg-config | ||
|
||
# Install python and pip | ||
RUN apt-get update -y && apt-get install -y \ | ||
python3 \ | ||
python3-dev \ | ||
python3-pip | ||
# Install miscellaneous packages | ||
RUN apt-get install -y \ | ||
vim \ | ||
net-tools \ | ||
chrony \ | ||
corkscrew \ | ||
libglib2.0-dev \ | ||
libyaml-cpp-dev | ||
|
||
RUN apt-get install -y \ | ||
libjpeg-dev | ||
|
||
RUN pip3 install Cython | ||
RUN pip3 install pillow \ | ||
PyYAML \ | ||
numpy \ | ||
protobuf==3.19 | ||
|
||
RUN apt-get install -y python3-opencv | ||
RUN apt-get install -y libegl1 libgles2-mesa libglu1 libdevil-dev | ||
|
||
#setup entrypoint to run the demo application | ||
ENTRYPOINT ["/usr/bin/entrypoint.sh"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Ubuntu 18 Docker Setup | ||
- [Ubuntu 18 Docker Setup](#u18-docker-setups) | ||
- [Introduction](#introduction) | ||
- [Setup](#setup) | ||
- [Copying the libraries](#copying-the-libraries) | ||
|
||
|
||
|
||
## Introduction | ||
|
||
- This folder have instructions on how to build and deploy Ubuntu 18.04 docker images on Target(Tested on J7ES) | ||
|
||
|
||
## Setup | ||
- On target run the following. This will create the image and log in to the docker container | ||
- Make sure no existing container is running by ``` docker container ls ``` | ||
``` | ||
cd edgeai-tidl-tools/dockers/ubuntu_18.04 | ||
./docker_build.sh | ||
./docker_run.sh | ||
``` | ||
- Host filesystem (PSDKRA device file system ) volume is mounted at /host inside container | ||
- Run the commands inside container | ||
|
||
``` | ||
cd /host/<path_to_edge_ai_tidl_tools>/dockers/ubuntu_18.04 | ||
source container_stup.sh # This will take care of additional dependencies (opencv not included) | ||
source container_stup.sh --opencv_install 1 # This will take care of additional dependencies (opencv included) | ||
``` | ||
|
||
## Running the examples | ||
- Run the python model compile on PC [Model Compilation on PC](../../../examples/osrt_python/README.md#model-compilation-on-pc) | ||
- Run the python examples on target [Run Inference on Target](../../../examples/osrt_python/README.md#model-inference-on-evm) | ||
- Compile the CPP application by following instruction from [Compile CPP examples](../../../examples/osrt_cpp/README.md#setup) |
Oops, something went wrong.