fix readme

add export py
add dll
This commit is contained in:
Alex Bezdieniezhnykh
2024-08-23 13:40:08 +03:00
parent d2dae732b9
commit 330d4b914a
7 changed files with 57 additions and 22 deletions
+33 -4
View File
@@ -1,5 +1,12 @@
1. Install necessary libs and drivers
```
**1. Install necessary libs and drivers**
https://www.python.org/downloads/
Windows
* [Install CUDA](https://developer.nvidia.com/cuda-12-1-0-download-archive)
Linux
* ```
sudo apt install nvidia-driver-535
wget https://developer.download.nvidia.com/compute/cudnn/9.2.0/local_installers/cudnn-local-repo-ubuntu2204-9.2.0_1.0-1_amd64.deb
@@ -10,10 +17,32 @@ sudo apt-get update
sudo apt-get -y install cudnn nvidia-cuda-toolkit -y
nvcc --version
```
2. Install dependencies
**2. Install dependencies**
* (Optional) Install virtual env:
```
pip install virtualenv
python -m venv env
env\Scripts\activate
```
```
python -m pip install --upgrade pip
pip install --upgrade huggingface_hub
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
pip install ultralytics albumentations
pip install git+https://github.com/airockchip/ultralytics_yolov8.git
pip install albumentations onnx
```
**3. Fix possible problems**
* Windows:
* cv2.error: OpenCV(4.10.0) ...\window.cpp:1301: error: (-2:Unspecified error)
```
pip uninstall opencv-python
pip install opencv-python
```
* fbgemm.dll error
```
copypaste libomp140.x86_64.dll to C:\Windows\System32
```
+7 -4
View File
@@ -3,12 +3,15 @@ apt update
apt upgrade
apt install -y ssh
groupadd sftp
useradd -g sftp -M -p Azaion1000sftp01 -d /azaion-media -s /bin/false sftpuser
adduser azaionsftp
mkdir /azaion-media/sftphome
chown -R azaionsftp:azaionsftp /azaion-media/sftphome/
chmod -R 755 /azaion-media/sftphome/
cat <<EOT >> /etc/ssh/sshd_config
Match Group sftp
ChrootDirectory /azaion-media
Match Group azaionsftp
ChrootDirectory %h
X11Forwarding no
ForceCommand internal-sftp
AllowTcpForwarding no
+5
View File
@@ -0,0 +1,5 @@
import onnx
from ultralytics import YOLO
model = YOLO('azaion-2024-08-13.pt')
model.export(format='rknn')
Binary file not shown.
@@ -4,7 +4,6 @@ from ultralytics import YOLO
# from vidgear.gears import CamGear
import cv2
from time import sleep
from os import path
model = YOLO('azaion-2024-08-13.pt')
@@ -16,8 +15,8 @@ fourcc = cv2.VideoWriter_fourcc('m', 'p', '4', 'v')
input_name = sys.argv[1]
output_name = Path(input_name).stem + '_recognised.mp4'
v_input = cv2.VideoCapture(path.join('tests', input_name))
v_output = cv2.VideoWriter('', fourcc, 20.0, (640, 480))
v_input = cv2.VideoCapture(input_name)
v_output = cv2.VideoWriter(output_name, fourcc, 20.0, (640, 480))
while v_input.isOpened():
ret, frame = v_input.read()
@@ -28,8 +27,8 @@ while v_input.isOpened():
frame_detected = results[0].plot()
frame_detected = cv2.resize(frame_detected, (640, 480))
# cv2.imshow('Video', frame_detected)
# sleep(0.03)
cv2.imshow('Video', frame_detected)
sleep(0.01)
v_output.write(frame_detected)
if cv2.waitKey(1) & 0xFF == ord('q'):
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

-1
View File
@@ -1 +0,0 @@
0 0.3809 0.49269 0.21636 0.39129