mirror of
https://github.com/azaion/ai-training.git
synced 2026-04-23 02:06:35 +00:00
fix readme
add export py add dll
This commit is contained in:
@@ -1,19 +1,48 @@
|
|||||||
1. Install necessary libs and drivers
|
**1. Install necessary libs and drivers**
|
||||||
```
|
|
||||||
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
|
https://www.python.org/downloads/
|
||||||
sudo dpkg -i cudnn-local-repo-ubuntu2204-9.2.0_1.0-1_amd64.deb
|
|
||||||
|
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
|
||||||
|
sudo dpkg -i cudnn-local-repo-ubuntu2204-9.2.0_1.0-1_amd64.deb
|
||||||
|
|
||||||
|
sudo cp /var/cudnn-local-repo-ubuntu2204-9.2.0/cudnn-*-keyring.gpg /usr/share/keyrings/
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get -y install cudnn nvidia-cuda-toolkit -y
|
||||||
|
nvcc --version
|
||||||
|
```
|
||||||
|
|
||||||
|
**2. Install dependencies**
|
||||||
|
|
||||||
|
* (Optional) Install virtual env:
|
||||||
|
```
|
||||||
|
pip install virtualenv
|
||||||
|
python -m venv env
|
||||||
|
env\Scripts\activate
|
||||||
|
```
|
||||||
|
|
||||||
sudo cp /var/cudnn-local-repo-ubuntu2204-9.2.0/cudnn-*-keyring.gpg /usr/share/keyrings/
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get -y install cudnn nvidia-cuda-toolkit -y
|
|
||||||
nvcc --version
|
|
||||||
```
|
|
||||||
2. Install dependencies
|
|
||||||
```
|
```
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install --upgrade huggingface_hub
|
pip install --upgrade huggingface_hub
|
||||||
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
|
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
|
||||||
|
```
|
||||||
|
|||||||
@@ -3,12 +3,15 @@ apt update
|
|||||||
apt upgrade
|
apt upgrade
|
||||||
apt install -y ssh
|
apt install -y ssh
|
||||||
|
|
||||||
groupadd sftp
|
adduser azaionsftp
|
||||||
useradd -g sftp -M -p Azaion1000sftp01 -d /azaion-media -s /bin/false sftpuser
|
|
||||||
|
mkdir /azaion-media/sftphome
|
||||||
|
chown -R azaionsftp:azaionsftp /azaion-media/sftphome/
|
||||||
|
chmod -R 755 /azaion-media/sftphome/
|
||||||
|
|
||||||
cat <<EOT >> /etc/ssh/sshd_config
|
cat <<EOT >> /etc/ssh/sshd_config
|
||||||
Match Group sftp
|
Match Group azaionsftp
|
||||||
ChrootDirectory /azaion-media
|
ChrootDirectory %h
|
||||||
X11Forwarding no
|
X11Forwarding no
|
||||||
ForceCommand internal-sftp
|
ForceCommand internal-sftp
|
||||||
AllowTcpForwarding no
|
AllowTcpForwarding no
|
||||||
|
|||||||
@@ -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
|
# from vidgear.gears import CamGear
|
||||||
import cv2
|
import cv2
|
||||||
from time import sleep
|
from time import sleep
|
||||||
from os import path
|
|
||||||
|
|
||||||
model = YOLO('azaion-2024-08-13.pt')
|
model = YOLO('azaion-2024-08-13.pt')
|
||||||
|
|
||||||
@@ -16,8 +15,8 @@ fourcc = cv2.VideoWriter_fourcc('m', 'p', '4', 'v')
|
|||||||
input_name = sys.argv[1]
|
input_name = sys.argv[1]
|
||||||
output_name = Path(input_name).stem + '_recognised.mp4'
|
output_name = Path(input_name).stem + '_recognised.mp4'
|
||||||
|
|
||||||
v_input = cv2.VideoCapture(path.join('tests', input_name))
|
v_input = cv2.VideoCapture(input_name)
|
||||||
v_output = cv2.VideoWriter('', fourcc, 20.0, (640, 480))
|
v_output = cv2.VideoWriter(output_name, fourcc, 20.0, (640, 480))
|
||||||
|
|
||||||
while v_input.isOpened():
|
while v_input.isOpened():
|
||||||
ret, frame = v_input.read()
|
ret, frame = v_input.read()
|
||||||
@@ -28,8 +27,8 @@ while v_input.isOpened():
|
|||||||
frame_detected = results[0].plot()
|
frame_detected = results[0].plot()
|
||||||
|
|
||||||
frame_detected = cv2.resize(frame_detected, (640, 480))
|
frame_detected = cv2.resize(frame_detected, (640, 480))
|
||||||
# cv2.imshow('Video', frame_detected)
|
cv2.imshow('Video', frame_detected)
|
||||||
# sleep(0.03)
|
sleep(0.01)
|
||||||
|
|
||||||
v_output.write(frame_detected)
|
v_output.write(frame_detected)
|
||||||
if cv2.waitKey(1) & 0xFF == ord('q'):
|
if cv2.waitKey(1) & 0xFF == ord('q'):
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 105 KiB |
@@ -1 +0,0 @@
|
|||||||
0 0.3809 0.49269 0.21636 0.39129
|
|
||||||
Reference in New Issue
Block a user