Add scripts folder
Signed-off-by: Micaela Verucchi <micaelaverucchi@gmail.com>
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd demo
|
||||
wget https://cloud.hipert.unimore.it/s/LNxBDk4wzqXPL8c/download -O COCO_val2017.zip
|
||||
unzip -d COCO_val2017 COCO_val2017.zip
|
||||
rm COCO_val2017.zip
|
||||
cd COCO_val2017/
|
||||
realpath labels/* > all_labels.txt
|
||||
@@ -0,0 +1,66 @@
|
||||
#!/bin/bash
|
||||
|
||||
#based on https://devtalk.nvidia.com/default/topic/1042035/installing-opencv4-on-xavier/ & https://github.com/markste-in/OpenCV4XAVIER/blob/master/buildOpenCV4.sh
|
||||
|
||||
# Compute Capabilities can be found here https://developer.nvidia.com/cuda-gpus#compute
|
||||
ARCH_BIN=7.2 # AGX Xavier
|
||||
#ARCH_BIN=6.2 # Tx2
|
||||
|
||||
cd ~/Downloads
|
||||
sudo apt-get install -y build-essential \
|
||||
unzip \
|
||||
pkg-config \
|
||||
libjpeg-dev \
|
||||
libpng-dev \
|
||||
libtiff-dev \
|
||||
libavcodec-dev \
|
||||
libavformat-dev \
|
||||
libswscale-dev \
|
||||
libv4l-dev \
|
||||
libxvidcore-dev \
|
||||
libx264-dev \
|
||||
libgtk-3-dev \
|
||||
libatlas-base-dev \
|
||||
gfortran \
|
||||
python3-dev \
|
||||
python3-venv \
|
||||
libgstreamer1.0-dev \
|
||||
libgstreamer-plugins-base1.0-dev \
|
||||
libdc1394-22-dev \
|
||||
libavresample-dev
|
||||
|
||||
git clone https://github.com/opencv/opencv.git
|
||||
git clone https://github.com/opencv/opencv_contrib.git
|
||||
|
||||
python3 -m venv opencv4
|
||||
source opencv4/bin/activate
|
||||
pip install wheel
|
||||
pip install numpy
|
||||
|
||||
cd opencv && mkdir build && cd build
|
||||
|
||||
cmake -D CMAKE_BUILD_TYPE=RELEASE \
|
||||
-D CMAKE_INSTALL_PREFIX=/usr/local \
|
||||
-D INSTALL_PYTHON_EXAMPLES=ON \
|
||||
-D INSTALL_C_EXAMPLES=OFF \
|
||||
-D OPENCV_EXTRA_MODULES_PATH='~/Downloads/opencv_contrib/modules' \
|
||||
-D PYTHON_EXECUTABLE='~/Downloads/opencv4/bin/python' \
|
||||
-D BUILD_EXAMPLES=ON \
|
||||
-D WITH_CUDA=ON \
|
||||
-D CUDA_ARCH_BIN=${ARCH_BIN} \
|
||||
-D CUDA_ARCH_PTX="" \
|
||||
-D ENABLE_FAST_MATH=ON \
|
||||
-D CUDA_FAST_MATH=ON \
|
||||
-D WITH_CUBLAS=ON \
|
||||
-D WITH_LIBV4L=ON \
|
||||
-D WITH_GSTREAMER=ON \
|
||||
-D WITH_GSTREAMER_0_10=OFF \
|
||||
-D WITH_TBB=ON \
|
||||
../
|
||||
|
||||
make -j4
|
||||
sudo make install
|
||||
sudo ldconfig
|
||||
|
||||
cd '~/Downloads/opencv4/lib/python3.6/site-packages'
|
||||
ln -s /usr/local/lib/python3.6/site-packages/cv2.cpython-36m-aarch64-linux-gnu.so cv2.so
|
||||
@@ -0,0 +1,86 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd build
|
||||
|
||||
RED='\033[1;31m'
|
||||
GREEN='\033[1;32m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
function print_output {
|
||||
if [ $1 -eq 0 ]
|
||||
then
|
||||
echo -e "$2 ${GREEN}OK${NC}"
|
||||
else
|
||||
echo -e "$2 ${RED}NOT OKAY${NC}"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
out_file=results.log
|
||||
rm $out_file
|
||||
|
||||
./test_resnet101_cnet &>> $out_file
|
||||
res_resnet101_cnet=$?
|
||||
print_output $res_resnet101_cnet test_resnet101_cnet
|
||||
|
||||
./test_yolo3 &>> $out_file
|
||||
res_yolo3=$?
|
||||
print_output $res_yolo3 test_yolo3
|
||||
|
||||
./test_yolo3_flir &>> $out_file
|
||||
res_yolo3_flir=$?
|
||||
print_output $res_yolo3_flir test_yolo3_flir
|
||||
|
||||
./test_yolo3_512 &>> $out_file
|
||||
res_yolo3_512=$?
|
||||
print_output $res_yolo3_512 test_yolo3_512
|
||||
|
||||
./test_yolo3_tiny &>> $out_file
|
||||
res_yolo3_tiny=$?
|
||||
print_output $res_yolo3_tiny test_yolo3_tiny
|
||||
|
||||
./test_csresnext50-panet-spp &>> $out_file
|
||||
res_csresnext50panetspp=$?
|
||||
print_output $res_csresnext50panetspp "test_csresnext50-panet-spp"
|
||||
|
||||
./test_mobilenetv2ssd &>> $out_file
|
||||
res_mobilenetv2ssd=$?
|
||||
print_output $res_mobilenetv2ssd test_mobilenetv2ssd
|
||||
|
||||
./test_yolo3_tiny512 &>> $out_file
|
||||
res_yolo3_tiny512=$?
|
||||
print_output $res_yolo3_tiny512 test_yolo3_tiny512
|
||||
|
||||
./test_yolo_tiny &>> $out_file
|
||||
res_yolo_tiny=$?
|
||||
print_output $res_yolo_tiny test_yolo_tiny
|
||||
|
||||
./test_mobilenetv2ssd512 &>> $out_file
|
||||
res_mobilenetv2ssd512=$?
|
||||
print_output $res_mobilenetv2ssd512 test_mobilenetv2ssd512
|
||||
|
||||
./test_mnist &>> $out_file
|
||||
res_mnist=$?
|
||||
print_output $res_mnist test_mnist
|
||||
|
||||
./test_yolo &>> $out_file
|
||||
res_yolo=$?
|
||||
print_output $res_yolo test_yolo
|
||||
|
||||
./test_yolo3_berkeley &>> $out_file
|
||||
res_yolo3_berkeley=$?
|
||||
print_output $res_yolo3_berkeley test_yolo3_berkeley
|
||||
|
||||
./test_yolo_voc &>> $out_file
|
||||
res_yolo_voc=$?
|
||||
print_output $res_yolo_voc test_yolo_voc
|
||||
|
||||
./test_dla34_cnet &>> $out_file
|
||||
res_dla34_cnet=$?
|
||||
print_output $res_dla34_cnet test_dla34_cnet
|
||||
|
||||
./test_yolo3_coco4 &>> $out_file
|
||||
res_yolo3_coco4=$?
|
||||
print_output $res_yolo3_coco4 test_yolo3_coco4
|
||||
|
||||
echo "If errors occured, check logfile $out_file"
|
||||
Reference in New Issue
Block a user