mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-08-04 18:08:50 +03:00
add converter to generate yolo4 models
This commit is contained in:
Executable
+45
@@ -0,0 +1,45 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
folder=${HOME}/src
|
||||
mkdir -p $folder
|
||||
|
||||
echo "** Install requirements"
|
||||
sudo apt-get install -y autoconf libtool
|
||||
|
||||
echo "** Download protobuf-3.8.0 sources"
|
||||
cd $folder
|
||||
if [ ! -f protobuf-python-3.8.0.zip ]; then
|
||||
wget https://github.com/protocolbuffers/protobuf/releases/download/v3.8.0/protobuf-python-3.8.0.zip
|
||||
fi
|
||||
if [ ! -f protoc-3.8.0-linux-aarch_64.zip ]; then
|
||||
wget https://github.com/protocolbuffers/protobuf/releases/download/v3.8.0/protoc-3.8.0-linux-aarch_64.zip
|
||||
fi
|
||||
|
||||
echo "** Install protoc"
|
||||
unzip protobuf-python-3.8.0.zip
|
||||
unzip protoc-3.8.0-linux-aarch_64.zip -d protoc-3.8.0
|
||||
sudo cp protoc-3.8.0/bin/protoc /usr/local/bin/protoc
|
||||
|
||||
echo "** Build and install protobuf-3.8.0 libraries"
|
||||
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp
|
||||
cd protobuf-3.8.0/
|
||||
./autogen.sh
|
||||
./configure --prefix=/usr/local
|
||||
make -j$(nproc)
|
||||
make check
|
||||
sudo make install
|
||||
sudo ldconfig
|
||||
|
||||
echo "** Update python3 protobuf module"
|
||||
# remove previous installation of python3 protobuf module
|
||||
sudo apt-get install -y python3-pip
|
||||
sudo pip3 uninstall -y protobuf
|
||||
sudo pip3 install Cython
|
||||
cd python/
|
||||
python3 setup.py build --cpp_implementation
|
||||
python3 setup.py test --cpp_implementation
|
||||
sudo python3 setup.py install --cpp_implementation
|
||||
|
||||
echo "** Build protobuf-3.8.0 successfully"
|
||||
Executable
+14
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -xe
|
||||
cd /tensorrt_demos/plugins && make
|
||||
|
||||
cd /tensorrt_demos/yolo
|
||||
for model in yolov4-tiny-288 \
|
||||
yolov4-tiny-416 \
|
||||
yolov4-288 \
|
||||
yolov4-416 ; do
|
||||
python3 yolo_to_onnx.py -m ${model}
|
||||
python3 onnx_to_tensorrt.py -m ${model}
|
||||
cp /tensorrt_demos/yolo/${model}.trt /model/${model}.trt
|
||||
done
|
||||
Reference in New Issue
Block a user