Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
if [ "$TERM_PROGRAM" != "vscode" ]; then
if ! has nix_direnv_version || ! nix_direnv_version 3.0.5; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.5/direnvrc" "sha256-RuwIS+QKFj/T9M2TFXScjBsLR6V3A17YVoEW/Q6AZ1w="
fi
watch_file nix/*.nix
use flake
fi
21 changes: 21 additions & 0 deletions .github/workflows/flake-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Validate Nix Flake

on:
workflow_dispatch:
pull_request:

jobs:
check-flake:
runs-on: ubuntu-22.04

steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Install Lix
uses: DeterminateSystems/nix-installer-action@90bb610b90bf290cad97484ba341453bd1cbefea # v19
with:
source-url: https://install.lix.systems/lix/lix-installer-x86_64-linux
logger: pretty

- name: Check Flake
run: nix flake check --print-build-logs --no-sandbox
30 changes: 30 additions & 0 deletions .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Run package tests

on:
push:
branches:
- "**" # all branches
pull_request:
branches:
- "**"
workflow_call: {}
workflow_dispatch: {}

jobs:
test-and-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: 3.12
- name: Install Hatch
uses: pypa/hatch@a3c83ab3d481fbc2dc91dd0088628817488dd1d5
- name: Run tests
run: |
# TODO: Re-enable tests after figuring out why MQTT disconnects on CI
# hatch test --all
hatch run lint:lint-check
hatch run lint:format-check
hatch run types:check
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/.direnv/
/.pre-commit-config.yaml
/.ruff_cache
/.venv
/.env
*.pt
__pycache__
/dist/
3 changes: 3 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[default.extend-words]
# Don't correct the mosquitto project name
mosquitto = "mosquitto"
2 changes: 1 addition & 1 deletion Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ RUN pip install --no-cache-dir -r requirements.txt
# downloading and caching the model
RUN yolo predict model=yolo11m.pt source='https://ultralytics.com/images/bus.jpg' && rm bus.jpg && rm -r runs/detect/predict

COPY count.py ./
COPY src/peep/__init__.py ./count.py

CMD (udevadm control --reload; python3 count.py)
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ Obviously from here you can do what you want with the data (e.g. send it to ~~di
The system runs on balena (Raspberry pi 3 64-bit, OS version balenaOS 6.1.24+rev1, supervisor version 16.10.3).
Just make sure you set `BALENA_HOST_CONFIG_camera_auto_detect=1` in balena configuration.



The system was created for internal use in [Hackerspace Trójmiasto](https://hs3.pl).


More info (blog posts / photo's / etc) will follow.
4 changes: 2 additions & 2 deletions balena.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ assets:
repository:
type: blob.asset
data:
url: ''
url: ""
logo:
type: blob.asset
data:
url: ''
url: ""
data:
applicationConfigVariables:
- BALENA_HOST_CONFIG_gpu_mem: 128
Expand Down
183 changes: 0 additions & 183 deletions count.py

This file was deleted.

Loading