ITLab-CC / Virtual-Graffiti

2 stars 0 forks source link

Virtual-Graffiti

This Project is only tested on Ubuntu 22.04

Installation without GPU

How to install OpenCV 4.6.0 in Ubuntu 22.04

1. Install required libraries

1.1. First of all install update and upgrade your system:

$ sudo apt update
$ sudo apt upgrade

2.0. Install Python and OpenCV

$ sudo apt install python3 python3-pip
$ sudo pip install opencv-python

3.0. Setup Virtual-Graffiti

$ sudo apt install python3-tk -y
$ sudo apt install libevdev-dev -y
$ sudo pip install mss
$ sudo pip install pygame
$ sudo pip install thread6
$ sudo pip install tk
$ sudo pip install libevdev

3.1. Reboot system

$ sudo reboot

3.2. Run Virtual-Graffiti

$ sudo python main.py

Installation with GPU

How to install OpenCV 4.6.0 with CUDA 11.7.1 and CUDNN 8.5.0.96 in Ubuntu 22.04

1. Install required libraries

1.1. First of all install update and upgrade your system:

$ sudo apt update
$ sudo apt upgrade

1.2. Then, install required libraries:

1.3. Install Nvidia driver:

$ sudo apt install nvidia-driver-515 nvidia-dkms-515 -y

1.4. Install cuda (https://developer.nvidia.com/cuda-downloads)

$ wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-ubuntu2204.pin
$ sudo mv cuda-ubuntu2204.pin /etc/apt/preferences.d/cuda-repository-pin-600
$ wget https://developer.download.nvidia.com/compute/cuda/11.7.1/local_installers/cuda-repo-ubuntu2204-11-7-local_11.7.1-515.65.01-1_amd64.deb
$ sudo dpkg -i cuda-repo-ubuntu2204-11-7-local_11.7.1-515.65.01-1_amd64.deb
$ sudo cp /var/cuda-repo-ubuntu2204-11-7-local/cuda-*-keyring.gpg /usr/share/keyrings/
$ sudo apt-get update
$ sudo apt-get -y install cuda
$ sudo reboot 0

1.5. Install cuDNN (https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html)

$ sudo apt-get install zlib1g

2.0. Compile and install OpenCV with Cuda and cuDNN

3.0 EXAMPLE TO TEST OPENCV 4.5.2 with GPU in C++

4.0. Setup Virtual-Graffiti

$ pip install mouse
$ pip install mss
$ pip install pygame
$ pip install thread6
$ pip install pyuserinput

4.1. Run Virtual-Graffiti

$ python main.py

Source