test1
This commit is contained in:
@@ -1,39 +0,0 @@
|
|||||||
import os
|
|
||||||
import urllib.request as dowReq
|
|
||||||
import zipfile
|
|
||||||
|
|
||||||
val = input("Enter BDD or COCO :")
|
|
||||||
if(val == "COCO"):
|
|
||||||
url = "https://cloud.hipert.unimore.it/s/LNxBDk4wzqXPL8c/download"
|
|
||||||
lib = "..\demo\COCO_val2017"
|
|
||||||
lib_zip = "COCO_val2017.zip"
|
|
||||||
elif(val == "BDD"):
|
|
||||||
url = "https://cloud.hipert.unimore.it/s/bikqk3FzCq2tg4D/download"
|
|
||||||
lib = "..\demo\BDD100k_val"
|
|
||||||
lib_zip = "BDD100k_val.zip"
|
|
||||||
|
|
||||||
dowReq.urlretrieve(url,lib_zip)
|
|
||||||
|
|
||||||
with zipfile.ZipFile(lib_zip,'r') as zip_ref:
|
|
||||||
zip_ref.extractall(lib)
|
|
||||||
|
|
||||||
labelFolder = lib + "\labels"
|
|
||||||
imageFolder = lib + "\images"
|
|
||||||
|
|
||||||
file1 = open(".\\..\\demo\\all_labels.txt","a")
|
|
||||||
path1 = os.path.realpath(labelFolder)
|
|
||||||
for file in os.listdir(labelFolder):
|
|
||||||
valTemp = path1 + "\\" + file
|
|
||||||
valTemp = valTemp + '\n'
|
|
||||||
file1.write(valTemp)
|
|
||||||
file1.close()
|
|
||||||
|
|
||||||
file2 = open(".\\..\\demo\\all_images.txt","a")
|
|
||||||
path2 = os.path.realpath(imageFolder)
|
|
||||||
for file in os.listdir(imageFolder):
|
|
||||||
pathtemp = path2 + "\\" + file
|
|
||||||
pathtemp = pathtemp + '\n'
|
|
||||||
file2.write(pathtemp)
|
|
||||||
file2.close()
|
|
||||||
|
|
||||||
print("Completed")
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
|
|
||||||
function elaborate_testset {
|
|
||||||
wget $1 -O $2.zip
|
|
||||||
unzip -d $2 $2.zip
|
|
||||||
rm $2.zip
|
|
||||||
cd $2/
|
|
||||||
realpath labels/* > all_labels.txt
|
|
||||||
realpath images/* > all_images.txt
|
|
||||||
cd ..
|
|
||||||
}
|
|
||||||
|
|
||||||
cd demo
|
|
||||||
for valset in $@
|
|
||||||
do
|
|
||||||
|
|
||||||
if [ $valset = "COCO" ]; then
|
|
||||||
echo "Downloading $valset validation set in demo"
|
|
||||||
elaborate_testset "https://cloud.hipert.unimore.it/s/LNxBDk4wzqXPL8c/download" "COCO_val2017"
|
|
||||||
elif [ $valset = "BDD" ]; then
|
|
||||||
echo "Downloading $valset validation set in demo"
|
|
||||||
elaborate_testset "https://cloud.hipert.unimore.it/s/bikqk3FzCq2tg4D/download" "BDD100K_val"
|
|
||||||
fi
|
|
||||||
|
|
||||||
done
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
#!/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
|
|
||||||
@@ -1,99 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
cd build
|
|
||||||
|
|
||||||
RED='\033[1;31m'
|
|
||||||
GREEN='\033[1;32m'
|
|
||||||
ORANGE='\033[1;33m'
|
|
||||||
PINK='\033[1;95m'
|
|
||||||
NC='\033[0m' # No Color
|
|
||||||
|
|
||||||
function print_output {
|
|
||||||
if [ $1 -eq 0 ]; then
|
|
||||||
echo -e "$2 ${GREEN}OK${NC}"
|
|
||||||
elif [ $1 -eq 1 ]; then
|
|
||||||
echo -e "$2 ${RED}FATAL ERROR${NC}"
|
|
||||||
elif [ $1 -eq 2 ] || [ $1 -eq 10 ]; then
|
|
||||||
echo -e "$2 ${PINK}CUDNN ERROR${NC}"
|
|
||||||
elif [ $1 -eq 4 ] || [ $1 -eq 12 ]; then
|
|
||||||
echo -e "$2 ${PINK}TENSORRT ERROR${NC}"
|
|
||||||
elif [ $1 -eq 8 ]; then
|
|
||||||
echo -e "$2 ${PINK}CUDNN vs TENSORRT ERROR${NC}"
|
|
||||||
elif [ $1 -eq 6 ]; then
|
|
||||||
echo -e "$2 ${PINK}CUDNN & TENSORTRT ERROR${NC}"
|
|
||||||
elif [ $1 -eq 14 ]; then
|
|
||||||
echo -e "$2 ${PINK}ERROR FOR EVERY CHECK${NC}"
|
|
||||||
else
|
|
||||||
echo -e "$2 ${RED}NOT OKAY (OPENCV maybe)${NC}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
out_file=results.log
|
|
||||||
rm $out_file
|
|
||||||
|
|
||||||
function test_net {
|
|
||||||
./test_$1 &>> $out_file
|
|
||||||
print_output $? $1
|
|
||||||
./test_rtinference $1*.rt $TKDNN_BATCHSIZE &>> $out_file
|
|
||||||
print_output $? "batched $1"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
modes=( 1 ) # only FP32
|
|
||||||
# modes=( 1 2 ) # FP32 and FP16
|
|
||||||
# modes=( 1 2 3 ) # FP32, FP16 and INT8
|
|
||||||
|
|
||||||
for i in "${modes[@]}"
|
|
||||||
do
|
|
||||||
rm *rt
|
|
||||||
if [ $i -eq 1 ]
|
|
||||||
then
|
|
||||||
export TKDNN_MODE=FP32
|
|
||||||
echo -e "${ORANGE}Test FP32${NC}"
|
|
||||||
fi
|
|
||||||
if [ $i -eq 2 ]
|
|
||||||
then
|
|
||||||
export TKDNN_MODE=FP16
|
|
||||||
echo -e "${ORANGE}Test FP16${NC}"
|
|
||||||
fi
|
|
||||||
if [ $i -eq 3 ]
|
|
||||||
then
|
|
||||||
export TKDNN_MODE=INT8
|
|
||||||
export TKDNN_CALIB_LABEL_PATH=../demo/COCO_val2017/all_labels.txt
|
|
||||||
export TKDNN_CALIB_IMG_PATH=../demo/COCO_val2017/all_images.txt
|
|
||||||
echo -e "${ORANGE}Test INT8${NC}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
export TKDNN_BATCHSIZE=2
|
|
||||||
echo -e "${ORANGE}Batch $TKDNN_BATCHSIZE ${NC}"
|
|
||||||
|
|
||||||
test_net mnist
|
|
||||||
# ./test_imuodom &>> $out_file
|
|
||||||
# print_output $? imuodom
|
|
||||||
|
|
||||||
test_net yolo4
|
|
||||||
test_net yolo4-csp
|
|
||||||
test_net yolo4x
|
|
||||||
test_net yolo4_berkeley
|
|
||||||
test_net yolo4tiny
|
|
||||||
test_net yolo3
|
|
||||||
test_net yolo3_berkeley
|
|
||||||
test_net yolo3_coco4
|
|
||||||
test_net yolo3_flir
|
|
||||||
test_net yolo3_512
|
|
||||||
test_net yolo3tiny
|
|
||||||
test_net yolo3tiny_512
|
|
||||||
test_net yolo2
|
|
||||||
test_net yolo2_voc
|
|
||||||
#test_net yolo2tiny
|
|
||||||
test_net csresnext50-panet-spp
|
|
||||||
#test_net csresnext50-panet-spp_berkeley
|
|
||||||
test_net resnet101_cnet
|
|
||||||
test_net dla34_cnet
|
|
||||||
test_net mobilenetv2ssd
|
|
||||||
test_net mobilenetv2ssd512
|
|
||||||
test_net bdd-mobilenetv2ssd
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "If errors occured, check logfile $out_file"
|
|
||||||
Reference in New Issue
Block a user