wando-warden can watch terminal cameras (such as those at Wando Welch), read the timestamp from the image, and count the number of trucks.
- OCR (pytesseract) to extract timestamps
- AI object detection using AWS Rekognition
- Flexible storage options
wando-warden comes with a streamlit app that can be used to configure the app, manually scan cameras, and visualize the data.
-
Clone this repository:
git clone https://github.com/hunterjsb/wando-warden.git cd wando-warden
-
Create a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the required dependencies:
pip install -r requirements.txt
-
Edit the
terminals.yaml
file to configure your terminals and cameras. -
Set up environment variables for sensitive information. See .env.example.
Run the streamlit app dashboard with:
streamlit run app.py
Run the main script with the following command:
python -m warden --detect-trucks
--terminals
: Path to the YAML file containing terminal configurations (default: '../terminals.yaml')--storage
: Choose between 'local' or 's3' storage (default: 's3')--log-level
: Set the logging level (default: 'INFO')--db
: Database to store object detection results (default: ')
-
Run with default settings (S3 for photos, DynamoDB for results):
python -m warden
-
Use local photo storage and debug logging:
python -m warden --storage local --log-level DEBUG
-
Detect trucks and store the results in a postgresql db:
python -m warden --db postgres --detect-trucks
The Warden system now supports truck detection using AWS Rekognition. To use this feature:
- Ensure you have the necessary AWS permissions to use Rekognition.
- Set the
AWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY
environment variables with your AWS credentials. - Use the
--detect-trucks
flag when running the script:python -m warden --detect-trucks
- This will detect trucks in the captured images, count them, calculate the average confidence of the detections, and store this information in a SQLite database.
The truck detection data is stored in a SQLite database. By default, it's saved as truck_detections.db
in the current directory. See DB options below.
The Warden system now supports multiple database options for storing truck detection results:
- SQLite (default)
- MySQL
- PostgreSQL
- DynamoDB
To specify the database type, use the --db
flag:
python -m warden --detect-trucks --db [sqlite|mysql|postgres|dynamodb]
For each database type, you need to set the appropriate environment variables, the names are found in .env.example.
Note: For DynamoDB, ensure that you have the necessary AWS permissions and credentials set up.
To extend or modify the Warden system:
- Add new camera types in
terminal.py
- Implement new storage backends in
memory.py
- Enhance OCR capabilities in
ocr.py
- Adjust labels and object detection settings in
detection.py
- Edit default configuration values in
config.py
This project is licensed under MIT-0. See the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
If you encounter any problems or have any questions, please open an issue on the GitHub repository.