Standardize program name and description

This commit is contained in:
slashtechno 2023-10-22 09:24:11 -05:00
parent 96247767fb
commit d83315518a
Signed by: slashtechno
GPG Key ID: 8EC1D9D9286C2B17
7 changed files with 32 additions and 28 deletions

2
.vscode/launch.json vendored
View File

@ -8,7 +8,7 @@
"name": "Python: Module",
"type": "python",
"request": "launch",
"module": "set_detect_notify",
"module": "wyzely_detect",
"justMyCode": true
}
]

3
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,3 @@
{
"files.eol": "\n"
}

View File

@ -1,5 +1,5 @@
# Wyzely Detect
Recognize faces/objects in a video stream (from a webcam or a security camera) and send notifications to your phone (or other devices)
Recognize faces/objects in a video stream (from a webcam or a security camera) and send notifications to your devices
### Features
- Recognize objects
@ -14,21 +14,21 @@ Recognize faces/objects in a video stream (from a webcam or a security camera) a
### Poetry/Python
- Camera, either a webcam or a Wyze Cam
- All RTSP feeds _should_ work, however.
- Python
- 3.10.5 is confirmed to work and problems have been encountered with 3.11
- Python 3.10 or 3.11
- Poetry
### Docker
- A Wyze Cam
- Any other RTSP feed _should_ work, as mentioned above
- Python
- Poetry
- Docker
- Docker Compose
## What's not required
- A Wyze subscription
## Usage
### Installation
1. Clone this repo with `git clone https://github.com/slashtechno/wyze-face-recognition.git`
1. Clone this repo with `git clone https://github.com/slashtechno/wyze-face-recognition.git` <!-- This URL should be changed once the repo is renamed -->
2. `cd` into the cloned repository
3. Then, either install with [Poetry](https://python-poetry.org/) or run with Docker
@ -38,7 +38,7 @@ Recognize faces/objects in a video stream (from a webcam or a security camera) a
#### Poetry
1. `poetry install`
2. `poetry run -- set-detect-notify`
2. `poetry run -- wyzely-detect`
### Configuration
The following are some basic CLI options. Most flags have environment variable equivalents which can be helpful when using Docker.

View File

@ -3,7 +3,7 @@ networks:
all:
services:
bridge:
container_name: bridge-wyze
container_name: bridge-wyzely-detect
restart: unless-stopped
image: mrlt8/wyze-bridge:latest
# I think we can remove the ports, since we're using the network
@ -20,7 +20,7 @@ services:
all:
ntfy:
image: binwiederhier/ntfy
container_name: ntfy-wyze
container_name: ntfy-wyzely-detect
command:
- serve
environment:
@ -33,10 +33,10 @@ services:
restart: unless-stopped
networks:
all:
facial_recognition:
container_name: face-recognition-wyze
wyzely-detect:
container_name: wyzely-detect
restart: unless-stopped
# image: ghcr.io/slashtechno/wyze_face_recognition:latest
# image: ghcr.io/slashtechno/wyzely-detect:latest
build:
context: .
dockerfile: Dockerfile
@ -47,7 +47,7 @@ services:
environment:
- URL=rtsp://bridge:8554/cv
- NO_DISPLAY=true
- NTFY_URL=http://ntfy:80/set-detect-notify
- NTFY_URL=http://ntfy:80/wyzely-detect
depends_on:
- bridge

View File

@ -1,7 +1,7 @@
[tool.poetry]
name = "wyzely-detect"
version = "0.1.0"
description = "Detect all the things"
version = "0.1.8"
description = "Recognize faces/objects in a video stream (from a webcam or a security camera) and send notifications to your devices"
authors = ["slashtechno <77907286+slashtechno@users.noreply.github.com>"]
license = "MIT"
readme = "README.md"
@ -9,8 +9,7 @@ packages = [{include = "wyzely_detect"}]
[tool.poetry.dependencies]
# As of 10/21/23, Python 3.11 doesn't work (at least on Windows)
# Seems "^3.10" won't work because of TensorFlow or another library
# Works on 3.10 and 3.11, at least in my testing
python = ">=3.10, <3.12"
python-dotenv = "^1.0.0"
@ -25,6 +24,7 @@ torch = ">=2.0.0, !=2.0.1, !=2.1.0"
# https://stackoverflow.com/a/76477590/18270659
# https://discuss.tensorflow.org/t/tensorflow-io-gcs-filesystem-with-windows/18849/4
# Might be able to remove this version constraint later
tensorflow-io-gcs-filesystem = "0.31.0"
@ -47,6 +47,7 @@ build-backend = "poetry.core.masonry.api"
# Where possible, `black` will attempt to format to 88 characters
# However, setting ruff to 135 will allow for longer lines that can't be auto-formatted
line-length = 135
extend-select= ["FIX002"]
[tool.poetry.scripts]
wyzely-detect = "wyzely_detect.__main__:main"

View File

@ -34,8 +34,8 @@ def main():
print("No .env file found")
argparser = argparse.ArgumentParser(
prog="Detect It",
description="Detect it all!",
prog="Wyzely Detect",
description="Recognize faces/objects in a video stream (from a webcam or a security camera) and send notifications to your devices", # noqa: E501
epilog=":)",
)
@ -118,13 +118,13 @@ def main():
# Defaults for the stuff here and down are already set in notify.py.
# Setting them here just means that argparse will display the default values as defualt
# TODO: Perhaps just remove the default parameter and just add to the help message that the default is set is x
# TODO: Make ntfy optional in ntfy.py
notifcation_services = argparser.add_argument_group("Notification Services")
notifcation_services.add_argument(
"--ntfy-url",
default=os.environ["NTFY_URL"]
if "NTFY_URL" in os.environ and os.environ["NTFY_URL"] != ""
else "https://ntfy.sh/set-detect-notify",
else "https://ntfy.sh/wyzely-detect",
type=str,
help="The URL to send notifications to",
)

View File

@ -32,7 +32,7 @@ def thing_detected(
detection_window: int = 15,
detection_duration: int = 2,
notification_window: int = 15,
ntfy_url: str = "https://ntfy.sh/set-detect-notify",
ntfy_url: str = "https://ntfy.sh/wyzely-detect",
) -> dict:
"""
A function to make sure 2 seconds of detection is detected in 15 seconds, 15 seconds apart.