Skip to content

Learn how to create your first algorithm for 5controlS open-source platform

License

Notifications You must be signed in to change notification settings

5sControl/my-first-5s-algorithm

Repository files navigation

Are you eager to dive into the world of algorithm creation for the 5controls platform but feeling unsure where to start?

Look no further! We are delighted to present to you our comprehensive repository, designed to guide you through the process of building your very own protective jacket detection algorithm and seamlessly connecting it to the 5Control platform.

In this guide we will cover:

  • Step 1: Algorithm Development

  • Step 2: Integration with 5sControl Platform

During these steps you'll discover how to build, test and seamlessly connect your protective jacket detection algorithm to the 5controls platform, enabling it to generate violation reports and contribute to a safer working environment.

With our repository as your guide, you'll gain the knowledge and skills needed to create a powerful protective jacket detection algorithm within a matter of a couple of days.

Follow the step-by-step instructions, study the commits history for valuable insights, and witness your algorithm come to life.

image

Algorithmic processes optimisation

Optimizing the algorithmic processes used in our platform is an important direction for improving resource utilization efficiency. In this regard, it is proposed to consider a new architecture based on the idea of separating the model and the algorithm. Instead of each algorithm running its own copy of the model, we can establish shared access to a single server model, which will significantly reduce the memory usage.

The existing infrastructure will remain unchanged, but during the development of new algorithms, an architectural approach based on a single server model for multiple algorithms will be proposed. This will allow us to optimize resource utilization, as the amount of memory consumed by each algorithm will be significantly reduced. Approximately 500 MB of memory will be allocated for each algorithm, while the model on the server will occupy about 1.5 GB.

This approach will provide more efficient resource utilization and improve system performance overall, without requiring additional memory allocation when launching each new algorithm. As a result, we will be able to significantly reduce memory consumption and optimize the operation of our algorithm, leading to improved performance and resource savings.

Схема 5s-Page-12 drawio

Getting started

1. Build your project with commits history.

  1. Write your algorthm;
  2. Add your model and set some settings for the model. Specifically configure the parameters that we will accept from the model.

You have to download the models

image
  1. Let's add a class in order to receive an image from the server:
image
  1. The most important step: configuring report sending. Everything must be in the following format:
image
image

2. Run/Test code

python vest.py

3. Build image for my-first-5s-algorithm algorithm

  • For x86 users

    docker build -t 5scontrol/my-first-5s-algorithm:latest .

  • for AArch64 users

    docker buildx build --platform linux/amd64 -t 5scontrol/my-first-5s-algorithm:latest .

4. Push images

docker push 5scontrol/my-first-5s-algorithm:latest

5. Pulling images on the server

Go to 5controlS UI, Configuration tab. Click on the Add algorithm button.

image

Fill in the form, specifying the information about your algorithm and its docker image.

image

6. If all the steps are completed successfully, you will see your algorithm on the 5s platform!

License

AGPL-3.0

This algorithm uses third party libraries that are distributed under their own terms (see LICENSE-3RD-PARTY.md).


About

Learn how to create your first algorithm for 5controlS open-source platform

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published