This instructions will only work for v2021.0
.
- Install
tensorflow>=2
,scikit-learn
,opencv-python
,pycryptodome
,websocket
,tqdm
,dropbox
- Clone this repo (branch
v2021.0
) toaisecurity
cd aisecurity/scripts && python3 download.py <TOKEN>
, see Discord server (announcements
channel) for<TOKEN>
python3 facenet_test.py
- should recognize you if you are a junior
Assumes CUDA, CuDNN installed.
After general installation...
- Install
pycuda
andtensorrt
- Run
make
inutil/trt_mtcnn_plugin/mtcnn
- Run
./create_engines
in the same directory - Run
make
inutil/trt_mtcnn_plugin
- See "Install
facenet
engine" section
Follow these for Jetson-specific instructions, tested with Jetpack 4.5 (CUDA 10.2).
Make sure that wifi is connected: sudo nmcli device wifi connect <NETWORK_NAME> password <PASSWORD>
Only applicable if preloaded disk images are available. See the Google Drive folder
- Download and unzip the image from the Google Drive url (use
2021a1.img.gz
) - Plug in the microSD card and identify the
/dev/disk[n]
path usingdiskutil list
- Erase the microSD card using Disk Utility. Format should be changed from APFS to ExFAT
- Write the image:
sudo dd if=[path/to/img] of=/dev/disk[n]
- Be VERY careful with this command- a typo will irrecoverably screw up a) the microSD card or b) your computer
- Make sure to use barrel jack PSU and have the J48 jumper cap on
- Plug in microUSB and connect to computer
- Find the
tty.usb[id]
file in/dev/
and runscreen /dev/tty.usb[id]
- Login to the Nano;
cd aisecurity/scripts && python3 facenet_test.py
Only applicable if .engine
s are available. Use this if developing on an SD card != a1
.
sudo apt-get update
sudo apt-get install python3-pip
sudo pip3 install -U pip testresources setuptools==49.6.0 Cython
sudo pip3 install -U scikit-learn tqdm websocket pycryptodome dropbox
sudo pip3 install -U numpy==1.19.4
export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
Note: you might have to add the lines from steps 6 and 7 to the ~/.bashrc
file and run source ~/.bashrc
as well.
sudo apt-get update && sudo apt-get -y upgrade
sudo apt-get install -y --no-install-recommends python3 python3-setuptools python3-dev
sudo apt-get install -y git libssl-dev libusb-1.0-0-dev pkg-config libgtk-3-dev
sudo apt-get install -y libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev
git clone https://github.com/IntelRealSense/librealsense.git
cd ./librealsense
./scripts/setup_udev_rules.sh
mkdir build && cd build
cmake ../ -DBUILD_PYTHON_BINDINGS:bool=true
sudo make uninstall && sudo make clean && sudo make -j4 && sudo make install
nano ~/.bashrc
(or any text editor)- Enter the following line in
~/.bashrc
:export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python3.6/pyrealsense2
cd ~/ && git clone https://github.com/aisecurity/aisecurity.git
cd aisecurity && git submodule update --init
cd util/trt_mtcnn_plugin && make
cd ~/aisecurity/scripts && python3 download.py <TOKEN>
, see Discord server (announcements
channel) for<TOKEN>
python3 facenet_test.py
to ensure that everything works
Only follow these instructions if the .engine
files aren't available yet.
Unless developing on the a1
Jetson, do not use these instructions.
sudo apt-get update
sudo apt-get install libhdf5-serial-dev hdf5-tools libhdf5-dev zlib1g-dev zip libjpeg8-dev liblapack-dev libblas-dev gfortran python3-h5py
sudo apt-get install python3-pip
sudo pip3 install -U pip testresources setuptools==49.6.0
sudo pip3 install -U numpy==1.19.4 future==0.18.2 mock==3.0.5 keras_preprocessing==1.1.1 keras_applications==1.0.8 gast==0.2.2 futures protobuf pybind11
sudo pip3 install --pre --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v45 tensorflow
sudo pip3 install scikit-learn
python3 -m pip install pycuda pycryptodome tqdm websocket Cython
sudo pip3 install -U numpy==1.19.4
(this step might not be necessary, just make sure thatnumpy
version is1.19.4
after step 7)export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
sudo apt-get update && sudo apt-get -y upgrade
sudo apt-get install -y --no-install-recommends python3 python3-setuptools python3-dev
sudo apt-get install -y git libssl-dev libusb-1.0-0-dev pkg-config libgtk-3-dev
sudo apt-get install -y libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev
git clone https://github.com/IntelRealSense/librealsense.git
cd ./librealsense
./scripts/setup_udev_rules.sh
mkdir build && cd build
cmake ../ -DBUILD_PYTHON_BINDINGS:bool=true
sudo make uninstall && sudo make clean && sudo make -j4 && sudo make install
nano ~/.bashrc
(or any text editor)- Enter the following line in
~/.bashrc
:export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python3.6/pyrealsense2
cd ~/ && git clone https://github.com/aisecurity/aisecurity.git
cd aisecurity && git submodule update --init
cd face/trt_mtcnn_plugin/mtcnn && make && ./create_engines
. Change engine params indet1_relu.prototxt
orcreate_engines.cpp
(beforemake
) if necessarycd .. && make
- Change the paths in
config/config.json
so thatdefault_model
points to20180402-114759.engine
.
cd /usr/src/tensorrt/samples/trtexec && make
export PATH=$PATH:/usr/src/tensorrt/bin
cd ~/aisecurity/config/models && trtexec --saveEngine=20180402-114759.engine --uffNHWC --uff=20180402-114759.uff --uffInput=input,160,160,3 --fp16 --output=embeddings
cd ~/aisecurity/scripts && python3 facenet_test.py
to ensure that everything works