Code Monkey home page Code Monkey logo

hudsonsecurity / darknetnx Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 3.0 31.13 MB

Free and open deep learning API service using Darknet YOLO V4 that integrates with powered by NX video management software: Nx Witness, DW Spectrum, Hanwha Wave and other platforms.

Home Page: https://retrospect.video

License: Other

CMake 1.38% Makefile 0.25% PowerShell 0.47% Shell 1.40% C# 0.15% Batchfile 0.59% Python 4.78% C 62.66% C++ 13.24% Cuda 15.08%
darknet yolo yolov4 networkoptix nxwitness dwspectrum wave hanwhawave digitalwatchdog

darknetnx's Introduction

DARKNETNX - Darknet YoloV4 in NX VMS by MATTHEW DEL SALTO @ RETROSPECT.VIDEO LATEST UPDATE: FEB 02 2021 Integrated confidence level parameter as threshold. Integrated telegram notifications with parameters tgtoken tgid.

PREAMBLE: All of my work is free software, free as in freedom. GPL V3. Free and open security is a growing necessity as the cloud Gobles up more of our privacy and freedom bit by bit. Releasing free physical security software is one way We can take back our privacy while protecting our property.

Objective: Implement cost effective - easy to launch deep learning models in production for small surveillance systems primarly powered by NX VMS and other open platforms: DW Spectrum, Hanwha Wave, Network Optix, MotionEye

Overview: I am running this on a NVIDIA Jetson with decent results for 4 cameras with little activity. NX sends all motion detection events to the jetson through an http request. The jetson then responds by taking a snapshot and running the darknet models on it. The results are then parsed and returned to the server as a generic event.

Files: getweights.sh - gets the yolov4-tiny weight file darknetnx.sh - the main script that gets executed by the webhook darknet.json - the webhook daemon config listening on port 1337 runapi.sh - runs the webhook api with the above config run.sh - runs the webhook run file from crontab at reboot

YOLO-V4-TINY is the only weight file included if you want to use the full yolo v4 just download the weight file to the root where the other weight file exists.

QRD: Here we are turning a tuned darknet build into a web api. We are then triggering events in NX to send snapshots to the api. The api processes the image using the requested model and returns the results as a generic event. Within NX you can create rules around this generic event such as bookmarks, push notifications, etc. The stock weight and model is typcially applied best for person, vehicle and animal. Pushover support is now inherent, use it as the last wto variables

Steps:

  1. In the NX VMS create a user and password with admin functionality.
  2. Crate an event rule that is triggered by motion detection or analytics.
  3. Use this event to trigger an HTTP request to our local darknet server.

This requires seveveral variables. a. NX camera id b. darknet server IP c. NX Server IP and port or NX System ID URL d. Newly created username and password in step 1. e. the desired yolo model you want to run f. arbitrary camera name for notifications in NX

Event trigger example: http://192.168.1.219:1337/hooks/darknet?camid=dbeba7ec-6e25-856c-395b-d4b3993d2446&server=192.168.1.198:7001&user=ai&pass=ai123456&model=darknet-yolov4-tiny&name=Entrance&runtime=8&threshold=35&tgtoken=telegrambottoken&tgid=telegramuserid

  1. Create an event inside of NX that triggers based on the darknet generic event containing the variables of successful detection IE: Person or Vehicle
  2. Use this event to create a bookmark, push notification or anything else you can trigger with events!

Setup: apt-get install curl wget jshon jq webhook Add to the end of crontab as root @reboot /root/darknetnx/runapi.sh

NOTES: Currently only alerts on the highest confidence object. Separate motion eye scripts and nxwitness scripts.

TODO: Allow all objects above a certain percentage. dockerize the service

darknetnx's People

Contributors

hudsonsecurity avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

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.