Code Monkey home page Code Monkey logo

whosthat's Introduction

About The Project

whosthat is app for detecting people on CCTV/cameras and sending notifications with photo snapshots using Telegram bot.

whosthat in action

This is what it looks like on my phone in action.
Never misses a single person, not even in infrared mode (during night time) :)
(blurred for privacy reasons)
alt text

Built With

  • Java 14
  • Spring Boot 2.4.2
  • OpenCV 4.2.0-0
  • darknet/yolo

Tested with

  • Docker 20.10.5
  • Gradle 6.7.1
  • HikVision VR DS-7604NI-K1 / 4P

Getting Started

Prerequisites

To be able to run whosthat, working Docker installation and gradle should be available on your machine:

  • check if Docker is working
    docker -v
    If version not printed, make sure to install Docker first.
  • check if gradle is working
    gradle -v
    If version not printed, make sure to install gradle first.

Installation

  1. Clone the repo
    git clone https://github.com/karlonovak/whosthat
    cd whosthat
  2. Build app and Docker image (might take a while to download darknet model)
    gradle docker
  3. Check if Docker image created
    docker images | grep whosthat
    whosthat image should be printed out.
  4. Fill in whosthat.env file with your data (see instructions below!)
  5. docker run --env-file whosthat.env whosthat
  6. If everything went well, success message should be shown:
    Started WhosThatApplication in x.xx seconds (JVM running for y.yyy)

Environment file

whosthat comes with provided example env file, whosthat.env file inside project root. Environment file should be filled in with your camera's data. Available variables are:

  1. [Optional] configurable log level for app, best left default
LOG_LEVEL=DEBUG
  1. [Mandatory] this param points to an HTTP address of a JPEG image of your camera. One such example (for my type of Hikvision camera) is shown below.
CAM_ADDRESS=http://192.168.1.50:6500/ISAPI/Streaming/channels/101/picture
  1. [Optional] BASIC/DIGEST auth username if needed
CAM_USER=admin
  1. [Optional] BASIC/DIGEST auth password if needed
CAM_PASS=admin1234
  1. [Optional] frequency at which snapshot is taken from the camera
CAM_FREQUENCY_IN_S=5
  1. [Optional] list of rectangles to exclude from detection if camera snapshots contains parts that don't need to be included for detection, example with two rectangles (delimited by '_'): 1980x0,2688x480_2400x0,2688x1520
CAM_CROP_RECTANGLES=
  1. [Optional] Path to darknet weights, default is the one suited for Docker container (automatically downloaded on image building)
YOLO_WEIGHTS=/opt/darknet/yolov3.weights
  1. [Optional] Path to darknet config, default is the one suited for Docker container (automatically downloaded on image building)
YOLO_CONFIG=/opt/darknet/cfg/yolov3.cfg
  1. [Mandatory] Telegram token (https://core.telegram.org/bots#6-botfather)
TELEGRAM_TOKEN=1785646214:ABHEd4GeiRNFRd_0dsvMKIgGmMVsDIBbosP
  1. [Mandatory] Chat ID of a group that bot should use to send detected images to (https://stackoverflow.com/questions/32423837/telegram-bot-how-to-get-a-group-chat-id)
TELEGRAM_CHAT_ID=-527125351
  1. [Optional] To avoid spam, declare a threshold for Telegram notifications
TELEGRAM_NOTIFICATION_THRESHOLD_IN_S=60

whosthat's People

Contributors

karlonovak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

whosthat's Issues

Q: How it's capturing ?

Could you please tell me how Hikvision camera is capturing? I have couple of question could you please help me by answering.

  • Is it possible to request camera to capture once we want ?
  • And how fast Hikvision Camera it is for complete flow (request camera to take picture?
  • Is it possible to read from that image for example If we want to capture picture of some banner or board and then we want to read that banner/board.
  • What is the purpose of this property CAM_FREQUENCY_IN_S=5

It would be great if you can provide more information.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.