This repository contains scripts and resources aimed at developing an AI-based system to detect objects from city cameras.
- Fetching dated images from an online camera every few seconds.
- Retrieving images labelled on Label Studio from an exported file (different formats supported: JSON, COCO and YOLO).
- Analysing fetched images using an object detection model (Mask R-CNN) to detect objects.
- Displaying the results on a dashboard with multiple plots and filters.
You first need to have Docker Compose installed (make sure the Docker daemon is running).
The easiest and recommended way is to install Docker Desktop. Refer to the Docker documentation.
Open a new terminal and follow these steps to set up the project:
-
Clone the repository
git clone https://github.com/Paulin-Dev/ObjectDetection.git
-
Navigate to the project directory
cd ObjectDetection -
Clone the environment file
cp .env.example .env
In the next section, you will have a better understanding of each variable and its purpose, allowing you to customize the configuration.
In Docker Desktop, you can view the containers with their status and logs.
You can run the entire pipeline using the following command:
docker-compose up -d fetcher object-detector dashboardYou can now access the dashboard at http://localhost:8080/.
Keep reading if you want to understand each service and how to customize the configuration.
VARIABLE means that this variable can be customized in the .env file.
You can fetch LOOP images, from a URL, every SLEEP_TIME seconds using the following command:
docker-compose up -d fetcherThis assumes you are using Label Studio for labelling and that you have already uploaded and labelled your images.
On Label Studio, in your project, you can find the PROJECT_ID in your browser URL. The ACCESS_TOKEN is visible in the "Account & Settings" tab (top right corner).
Back to your project, click "Export" and "Create New Snapshot". Then download it in one of the following formats: JSON, COCO or YOLO.
Move the downloaded file/folder to the root directory of this GitHub repository, and unzip the folder (for COCO and YOLO formats). You can now set/change the EXPORTED_FORMAT and EXPORTED_PATH in the .env file.
You can now retrieve your labelled images using the following command:
docker-compose up -d retrieverNB: Change the
REQUEST_INTERVALif you are being rate limited.
Images will be downloaded to the "JSON_images" directory at the project's root for JSON format, and to the "images" directory within exported directories for COCO and YOLO formats.
You can run the detector using the following command:
docker-compose up -d object-detectorYou can run the dashboard using the following command:
docker-compose up -d dashboardGuidelines for contributing to the project can be found in the CONTRIBUTING.md file.