Drones Machine Vision Augmentation.
📌 Hey, Everything is still under development. 🔨
Use miniconda 🐍 a free minimal installer for conda (The place where we will create the environment in which the programs will run).
Download the installer here for Windows. 🪟
We will download Python version 3.10
which comes with Conda 23.3.1 Python 3.10.10
released on April 24, 2023. 🐍
After the installation is completed we will search and open Anaconda Prompt which is an "enhanced" windows cmd which automatically includes the conda installation of Python to your PATH environment variable meaning there is no need to set the PYTHONPATH environment variable.
After everything is installed you should see something like this.
💡 If you run into any issues or need more guidance visit here.
⚡ To speed up the process of installing new depedencies we will use Libmamba a faster conda solver which can yield +(50-80)% resolving speeds. Do this by running the following commands on Anaconda Prompt:
conda update -n base conda
and
conda install -n base conda-libmamba-solver
conda config --set solver libmamba
💡For more info here.
We need to install the necesary dependencies which are required, to do this we should be Creating a new environment by using the following command:
conda create --name yolov8 python=3.10
We named the new env yolov8 and used python version 3.10. Afterwards we need to activate the new env by
activate yolov8
The (base) on the parathesis should now be changed to your new env name for me yolov8.
📘 We can skip all of the above if we are gonna just use this project and follow the below steps instead on the (base) env. 📢 It is not recomended as package issues might occures if future changes or prototyping happens.
💡 Here is a fast getting started tutorial and a helpful conda cheatsheet.
Now let's start with the fun part start by running on the activated conda environment in my case (yolov8):
pip install ultralytics
This gonna a take a while as it is downloading all the necessary packages and their depedencies to train, evaluate, predict and export a yolov8 model. 🔥
📢 This downloads the CPU 💻 version of Pytorch if you have a GPU ⚡ to run the model on you need to go to Pytorch
and install it with the apropriate cuda version by coping the command.
and running it on Anaconda Prompt by putting a --upgrade
in front of torch like this:
pip3 install --upgrade torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117
To check if everything has gone smoothly type python
followed by an import torch
followed by a torch.__version__
and torch.cuda_is_available()
( if you have a gpu) finally to exit type exit()
.
Click this or
Go to https://github.com/nikogarro/HellenicDrones and click on best.pt (this is the default pytorch model) and then download the raw file.
That's it everything is Set up! 📐
On Anaconda Prompt use the following commands while being on the right env (yolov8) for inference. 🔥
yolo task=detect mode=predict model=path_to_the_downloaded_model show=True source=your_image_or_video_directory line_width=1
💡 For webcam use source=0
and alternative for any other image or video formats including streaming RTSP, RTMP, HTTP
and all the acceptable arguments see detailed guide here
📢To stop the real time camera prediction press and hold q
.