Skip to content

schauppi/construction-site-monitoring

Repository files navigation

Project Overview

This project is a robust surveillance system utilizing two Reolink cameras connected to an NVIDIA Jetson Nano. It features a Flask API and storage on an external NAS to save images. System control and monitoring are achieved through a Telegram bot, and an additional Jetson Xavier runs a custom-trained object detection model using a Flask Detection API with TensorRT engine for YOLO models.

Architecture

Architecture

System Components

  1. Hardware
  • NVIDIA Jetson Nano
  • NVIDIA Jetson Xavier
  • Two Reolink cameras
  • External NAS for storage
  1. Software
  • Backend + Flask API for camera control and image storage
  • Telegram Bot for remote system control
  • Backend + Flask Detection API running on Jetson Xavier for person detection using YOLO

Installation and Setup

Wire the hardware components according to the architecture diagram. The software components are divided into two parts: the Jetson Nano and the Jetson Xavier.

For Jetson Nano and Xavier

  1. Environment Setup
  • Ensure you have Python 3.8 or higher installed
  • Create an virtual environment and activate it
python3 -m venv venv
source venv/bin/activate
  • Install the required packages
  • {} is either nano or xavier
pip install -r requirements_{}.txt
  1. Configuration
  • Create a new Telegram bot and get the API token
  • Change the .env example into .env and fill in the required information
    • TELEGRAM: Telegram API token
    • TELEGRAM_CHAT_ID: Chat ID for the bot
  • Setup the Reolink cameras with username, password and static ip
  • Change the reolink_credentials_example.json into reolink_credentials.json and fill in the required information
    • Username, Password, IP-address
  1. Running the system
  • Run the Flask API
python -m src.api.api

Jetson Xavier

  1. Configuration
  1. Running the system
  • Run the Flask Detection API
python -m src.detection.detection_api

Usage

  • Camera Control: Use Telegram commands to start/stop capturing, arm/disarm the cameras, and set the image capture interval.
  • Monitoring: Check system status, disk space, and get latest images through the Telegram bot.
  • Object Detection: Send images to the detection API running on Xavier to detect persons in real-time.

API Endpoints

  • Flask API on Jetson Nano

    • /start: Start image capturing.
    • /stop: Stop image capturing.
    • /status: Get system status.
    • /set_interval: Set image capture interval.
    • /get_image: Fetch latest captured images.
    • /disk_space: Check disk space usage.
    • /arm: Arm the system.
    • /disarm: Disarm the system.
    • /get_current_images: Get the latest images.
  • Object Detection API on Jetson Xavier

    • /detect: Endpoint to upload images for object detection.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages