The tool provides object detection on images. The tool provides means to select certain classes to be detected.
The tool can be used as a conventional AI tool (see the AI Toolbox). You can experiment with the query.ipynb
to check the tool capabilities. Also, you can deploy the tool as a REST service. Suppose, this tool is checked out into ~/aitools/sentinel
, then you can deploy it into /tmp/sentinel_deploy
python3 -m aitoolbox deploy ~/aitools/sentinel -o /tmp/sentinel_deploy
After that, go to the deploy directory and build the image:
cd /tmp/sentinel_deploy
docker compose build
docker compose up
Running the service, you can test it with the provided test/example.http
file and the Visual Code REST client extension.
The creation or acquisition of an appropriate dataset is one of the most critical for model performance. In this tutorial we will create our own dataset, using Roboflow (skip this part if you don't want your own dataset). Of course you can also use other annotation tools, here is some help on how to use them with YOLOv5.
To ensure good performance, it is necessary to collect at least 1500 images of each object to be learned. Since these images will be the basis for the model to learn what it needs to recognise, it is important to have a variety of images to use for training.
Once you have collected images, you will need to annotate the objects of interest to create a ground truth for your model to learn from. All you have to do is create a new workspace/project and upload your collected images there. If you have labeled images by default, Roboflow will automatically convert them to the correct format, otherwise you have to label them manually (for help with manual labelling click here).
After the preparation of the training images is finished, it is required to generate the database. Here are some important settings:
We have the possibility to load our own or other people's dataset from Roboflow Universe. If you select a dataset, you can press the "Download Dataset" button to load it directly using code. Here we have to select "YOLO v5 PyToch" and "show download code" It is important that you choose a dataset that contains a validation set, otherwise the YOLOv5 code will not be able to run.
The choice of the appropriate model depends largely on the task to be performed. Yolov5 has several types of pretrained models, which we only need to train further for our own task. The parameters of the different models can be found here. For simplicity and speed, we will now use the smallest model: YOLOv5n.
There are a lot of parameters that can be set for a YOLOv5 training, but for now we will only set some of the more important ones: