Image recognition program for UAV Concordia. Goal is to classify characters and shapes.
- Python is installed
- VS code is installed
- Python extension from microsoft installed in VS code
- pip (python package manager) is installed
If you're using Ubuntu WSL, also install cuda accelerate driver for WSL https://dev.to/naruaika/using-opencv-on-windows-subsystem-for-linux-1ako
- Install CUDA toolkit
- Install CUDNN
- Activate virutalenv
- Install numpy
- Download opencv & opencv_contrib
- Rename both folders
opencv
&opencv_contrib
- Make build directory and cd into it
- Run the following command to build opencv with CUDA configurations
cmake -D CUDA_ARCH_BIN=7.5 -D WITH_CUDA=ON -D WITH_CUDNN=ON -D OPENCV_DNN_CUDA=ON -D ENABLE_FAST_MATH=1 -D CUDA_FAST_MATH=1 -D WITH_CUBLAS=1 -D OPENCV_ENABLE_NONFREE=ON -D OPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules/ -D PYTHON3_EXECUTABLE=$HOME/uav-test/.venv/ -D PYTHON3_NUMPY_INCLUDE_DIRS=$HOME/uav-test/.venv/lib64/python3.10/site-packages/numpy/core/include -D CMAKE_INSTALL_PREFIX=$HOME/uav-test/.venv ../opencv
- run
make -j4
(jetson nano has 4 cpu cores only) - run
sudo make install
- Hopefully should workd
-
Install tesseract (pytesseract is just a wrapper, still needs the actual c++ code)
- Download the pkg installer based on the os you have https://www.macports.org/install.php
- Install tesseract with MacPorts
sudo port install tesseract
- To confirm that you installed it, run:
tesseract --version
- Also install one language package, e.g.
sudo port install tesseract-eng
-
Make sure your working directory is the project
cd UAV-OCR-Shape-detection/
- Install virtual environment
pip install virtualenv
- Create virtual environment
python3 -m venv .venv
- Activate virtual environment
source .venv/bin/activate
-
Set your python interpreter to the one in the .venv
-
Install the dependencies
pip install --upgrade pip
pip install -r requirements.txt
- Press the play button at the top left of the python script you want to run and you should be good to go!