Skip to content

Commit 64e9330

Browse files
author
عبدالله
authored
update AntiSpoofing system with performance improvements and fixes (#50)
2 parents 727ec4a + ef59608 commit 64e9330

117 files changed

Lines changed: 7824 additions & 2989 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.editorconfig‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
trim_trailing_whitespace = true
8+
9+
[*.{bat,cmd,ps1}]
10+
end_of_line = crlf

‎.github/workflows/build.yml‎

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,46 @@ name: Build SmartEye
22

33
on:
44
workflow_dispatch:
5+
pull_request:
6+
push:
7+
branches:
8+
- main
9+
- dev
510

611
jobs:
12+
validate:
13+
runs-on: windows-latest
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Python 3.12
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: "3.12"
23+
architecture: "x64"
24+
cache: "pip"
25+
cache-dependency-path: |
26+
requirements.txt
27+
requirements-dev.txt
28+
29+
- name: Install validation dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install -r requirements-dev.txt
33+
34+
- name: Ruff checks
35+
run: |
36+
python -m ruff check backend frontend utils scripts main.py tests --select F401,F821,F823,F811,F841,E722,B006,B007,B008,B023,B904,RUF012,RUF034
37+
38+
- name: Pytest
39+
run: |
40+
python -m pytest -q
41+
742
build:
43+
if: github.event_name == 'workflow_dispatch'
44+
needs: validate
845
runs-on: windows-latest
946
permissions:
1047
contents: write
@@ -65,7 +102,7 @@ jobs:
65102
run: |
66103
if (-not (Test-Path "data/models")) {
67104
if ($env:MODEL_BUNDLE_URL) {
68-
Write-Host "MODEL_BUNDLE_URL set — downloading model bundle..."
105+
Write-Host "MODEL_BUNDLE_URL set - downloading model bundle..."
69106
Invoke-WebRequest -Uri $env:MODEL_BUNDLE_URL -OutFile models.zip -UseBasicParsing
70107
Expand-Archive models.zip -DestinationPath data/models
71108
Remove-Item models.zip -Force
@@ -74,7 +111,7 @@ jobs:
74111
Write-Host "MODEL_BUNDLE_URL not set; skipping model download"
75112
}
76113
} else {
77-
Write-Host "data/models already exists — skipping download"
114+
Write-Host "data/models already exists - skipping download"
78115
}
79116
80117
- name: Cache Nuitka build cache

‎.gitignore‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,14 @@ htmlcov/
2020
Thumbs.db
2121

2222
build/
23+
build_assets/
2324
dist/
2425
site/
2526
docs/generated/exports/
2627
*.egg-info/
2728
*.spec
29+
SmartEye.nsi
30+
frontend/pyside6_plugins/
2831

2932
data/faces/*
3033
data/faces_inbox/*
@@ -37,7 +40,10 @@ data/clips/*
3740
data/clips_live/*
3841
data/cache/*
3942

40-
tests/
43+
docs/
44+
final_report.md
45+
final_report.pdf
46+
tests/notes.txt
4147

4248
data/*.db-wal
4349
data/*.db-shm

‎THIRD_PARTY_LICENSES.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ https://www.qt.io/
2424

2525
--------------------------------------------------
2626

27-
OpenCV (opencv-python, opencv-python-headless)
27+
OpenCV (opencv-python)
2828
License: Apache License 2.0
2929
https://opencv.org/
3030

‎app_info.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Smart Eye",
3-
"version": "0.1.0-alpha",
3+
"version": "0.1.0-Beta",
44
"author": "Smart Eye Team",
55
"description": "An Intelligent Safety Surveillance System."
66
}

‎backend/analytics/stats_engine.py‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,10 +265,17 @@ def _dummy_gender_violations(gender=None, min_alarm_level=None):
265265
return rows
266266

267267

268-
def get_summary(date_from=None, date_to=None, camera_id=None, min_alarm_level=None, gender=None):
268+
def get_summary(date_from=None, date_to=None, camera_id=None, min_alarm_level=None, gender=None, rule_name=None):
269269
if is_dummy_analytics_enabled():
270270
return _dummy_summary(min_alarm_level=min_alarm_level, gender=gender)
271-
stats = db.get_detection_stats(date_from, date_to, camera_id, min_alarm_level=min_alarm_level, gender=gender)
271+
stats = db.get_detection_stats(
272+
date_from,
273+
date_to,
274+
camera_id,
275+
min_alarm_level=min_alarm_level,
276+
gender=gender,
277+
rule_name=rule_name,
278+
)
272279
total = stats.get("total", 0) or 0
273280
violations = stats.get("violations", 0) or 0
274281
compliant = total - violations

0 commit comments

Comments
 (0)