{"id":21599485,"url":"https://github.com/abichinger/ninja-vs","last_synced_at":"2025-03-18T11:42:20.183Z","repository":{"id":116247349,"uuid":"447657120","full_name":"abichinger/ninja-vs","owner":"abichinger","description":"A Discord bot with object and motion detection for CCTV cameras","archived":false,"fork":false,"pushed_at":"2024-04-06T08:54:44.000Z","size":48472,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-24T17:48:12.635Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abichinger.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-01-13T15:46:40.000Z","updated_at":"2022-04-11T14:07:27.000Z","dependencies_parsed_at":"2024-04-05T13:43:31.279Z","dependency_job_id":null,"html_url":"https://github.com/abichinger/ninja-vs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abichinger%2Fninja-vs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abichinger%2Fninja-vs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abichinger%2Fninja-vs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abichinger%2Fninja-vs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abichinger","download_url":"https://codeload.github.com/abichinger/ninja-vs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244216783,"owners_count":20417651,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-24T18:15:30.058Z","updated_at":"2025-03-18T11:42:20.155Z","avatar_url":"https://github.com/abichinger.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NinjaVS\n\nA Discord bot with object and motion detection for CCTV cameras.\nThe NinjaVS bot will send you pictures, when something happens in front of your camera.\n\n# Features\n- Snapshot support\n- Motion detection \n- Object detection\n- Combined motion and object detection\n- CLI Interface\n\n# CLI Interface\n\n- `!list` - lists all available commands\n- `!help motion` - usage information of the `motion` command\n- `!set-interval -cooldown 3s \"!smart\" 1s` - perform motion+object detection every second\n\n# Install using Docker\n\nClone the repository\n```\ngit pull https://github.com/abichinger/ninja-vs.git\ncd ninja-vs\n```\n\n**Setup a discord bot**: \n1. Create a new discord [application](https://discord.com/developers/applications) and copy the application id\n2. Add a bot to your application and note the api token\n3. Replace `app_id` with your applicaton id and enter it into your browser: https://discord.com/api/oauth2/authorize?client_id=app_id\u0026permissions=52224\u0026scope=bot\n\nCreate `.env` file with all the required variables ([full list of environment varaibles](#environment-variables)).\n```ini\nNVS_INPUT=rtsp://username:password@host\nNVS_DISCORD_TOKEN=your_discord_token\nNVS_CAPTURE_WIDTH=2560\nNVS_CAPTURE_HEIGHT=1440\nNVS_CAPTURE_FPS=10\nNVS_CHANNEL_ID=123\n```\n\nBuild and start the docker container\n```\ndocker-compose build\ndocker-compose up -d\n```\n\n# Manual Installation\n\n## Requirements\n\n- ffmpeg\n- cmake\n- build-essential\n\nTODO\n\n# Environment Variables\n\n| Variable | Description | Required | Default\n| --- | --- | --- | ---\n| `NVS_INPUT` | input stream for ffmpeg | x \n| `NVS_DISCORD_TOKEN` | discord api token | x \n| `NVS_CAPTURE_WIDTH` | width of captured frames | x \n| `NVS_CAPTURE_HEIGHT` | height of captured frames | x \n| `NVS_CAPTURE_FPS` | fps processed by NinjaVS | x \n| `NVS_CHANNEL_ID` | input stream for ffmpeg | x \n| `NVS_ONNX_FILE` | path to onnx model | | `./dnn/yolov5s.onnx`\n| `NVS_STORAGE` | directory of persistent storage files | | `storage`\n| `NVS_CMD_PREFIX` | prefix to trigger NinjaVS | | `!`\n| `NVS_OBJECT_EXCLUDE` | coco class names to exclude | | `''`\n| `NVS_OBJECT_CONFIDENCE` | confidence threshold | | `0.6`\n| `NVS_MOTION_DELAY` | delay in ms between images | | `100`\n| `NVS_MOTION_AREA` | min size of motion in percent | | `0.001`\n| `NVS_MOTION_THRESHOLD` | threshold value between 0-255 | | `20`\n| `NVS_MOTION_BLUR` | kernel size of gaussian blur, must be odd | | `11`\n| `NVS_MOTION_WIDTH` | processing width | | `1000`\n\n# Development\n\n```bash\n# Install dependencies\nnpm install\n\n# Build opencv\nnpm run build-opencv\n\n# Run tests\nnpm run test\n\n# Run NinjaVS\nnpm run start\n\n```\n\n# Attribution\n\n[ultralytics/yolov5](https://github.com/ultralytics/yolov5) - origin of onnx model\n\n# Alternatives\n\n- [Shinobi](https://shinobi.video/) ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabichinger%2Fninja-vs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabichinger%2Fninja-vs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabichinger%2Fninja-vs/lists"}