Skip to content

Commit d3d9632

Browse files
committed
bs5
1 parent 3aee6ed commit d3d9632

Some content is hidden

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

64 files changed

+556
-1947
lines changed

.gitattributes

-4
This file was deleted.

.github/workflows/django.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@ on:
88

99
jobs:
1010
build:
11-
1211
runs-on: ubuntu-latest
1312
strategy:
1413
max-parallel: 4
1514
matrix:
16-
python-version: [ '3.10' ]
15+
python-version: [ '3.11' ]
1716

1817
steps:
1918
- uses: actions/checkout@v3

.github/workflows/docker-image.yml

-18
This file was deleted.

.github/workflows/pages.yml

-16
This file was deleted.

README.md

+12-23
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# tracker
22

3-
![Django CI](https://github.com/Husseinfo/tracker/actions/workflows/django.yml/badge.svg) ![Docker image CI](https://github.com/Husseinfo/tracker/actions/workflows/docker-image.yml/badge.svg)
3+
A face recognition based attendance system.
4+
5+
![Django CI](https://github.com/Husseinfo/tracker/actions/workflows/django.yml/badge.svg) ![Docker image CI](https://github.com/Husseinfo/tracker/actions/workflows/docker-image.yml/badge.svg)
46
[![GitHub license](https://img.shields.io/github/license/husseinfo/tracker.svg)](https://github.com/husseinfo/tracker/blob/main/LICENSE)
57
[![views-counter](https://github.com/Husseinfo/views-counter/blob/master/svg/90946301/badge.svg)](https://github.com/Husseinfo/views-counter/blob/master/readme/90946301/year.md)
68
[![GitHub stars](https://img.shields.io/github/stars/husseinfo/tracker.svg)](https://github.com/husseinfo/tracker/stargazers)
@@ -10,35 +12,22 @@
1012
- [OpenCV](https://github.com/opencv/opencv) replaced
1113
with [face_recognition](https://github.com/ageitgey/face_recognition/)
1214
- Upgraded to [Django 4](https://github.com/django/django/releases/tag/4.0.6)
15+
- UI with [django-bootstrap5](https://github.com/zostera/django-bootstrap5)
1316

1417
![homepage](https://github.com/Husseinfo/tracker/blob/main/static/images/homepage.png?raw=true)
1518

16-
## Overview
17-
18-
A face recognition based attendance system.
19-
20-
## Functionalities
21-
22-
- Login
23-
- Homepage: showing last stats of the system
24-
- Add user: to add new faces
25-
- Capture page: to take faces photos from a local or remote device
26-
- Train page: to train models
27-
- Attendance page: shows attendance records
28-
- A RESTful API interface to send attendance records (from the raspberry pi in the prototype device)
29-
30-
## Environment
19+
## Running
3120

32-
Python == 3.10
21+
Python 3.11
3322

3423
Install libraries: ```pip3 install -r requirements.txt```
3524

36-
## Running
37-
38-
Initialize the database from django:
25+
Initialize the database:
3926

40-
- ```python manage.py migrate```
41-
- ```python manage.py createsuperuser```
27+
```bash
28+
python manage.py migrate
29+
python manage.py createsuperuser
30+
```
4231

43-
Start the server:
32+
Run development server:
4433
```python manage.py runserver```

docker/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.10-slim
1+
FROM python:3.11-alpine
22

33
WORKDIR /opt
44

docs/index.md

-1
This file was deleted.

mkdocs.yml

-11
This file was deleted.

requirements.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
Django==4.1.13
2-
djangorestframework==3.14.0
32
face_recognition==1.3.0
43
scikit-learn==1.1.3
5-
mkdocs-material==8.5.9
4+
django-bootstrap5==23.4

sql/inoutTrigger.sql

+26-21
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,39 @@
11
-- auto-generated definition
22
create function checkinout() returns trigger
3-
language plpgsql
3+
language plpgsql
44
as $$
55
BEGIN
6-
IF new.inout IS NOT NULL
6+
IF
7+
new.inout IS NOT NULL
78
THEN
89
RETURN NULL;
9-
END IF;
10-
IF (SELECT COUNT(*)
11-
FROM tracker_attendance
12-
WHERE user_id = new.user_id AND date :: DATE = now() :: DATE) = 0
10+
END IF;
11+
IF
12+
(
13+
SELECT COUNT(*)
14+
FROM tracker_attendance
15+
WHERE user_id = new.user_id
16+
AND date :: DATE = now() :: DATE) = 0
1317
THEN
1418
new.inout := TRUE;
15-
ELSEIF (SELECT DISTINCT ON (date) inout
16-
FROM tracker_attendance
17-
WHERE user_id = new.user_id
18-
ORDER BY date DESC)
19+
ELSEIF
20+
(
21+
SELECT DISTINCT
22+
ON (date) inout
23+
FROM tracker_attendance
24+
WHERE user_id = new.user_id
25+
ORDER BY date DESC)
1926
THEN
20-
new.inout := FALSE;
21-
ELSE
27+
new.inout := FALSE;
28+
ELSE
2229
new.inout := TRUE;
23-
END IF;
24-
RETURN NULL;
30+
END IF;
31+
RETURN NULL;
2532
END
26-
$$
27-
;
33+
$$;
2834

2935
create trigger checkinouttrigger
30-
before insert
31-
on tracker_attendance
32-
for each row
33-
execute procedure checkinout()
34-
;
36+
before insert
37+
on tracker_attendance
38+
for each row
39+
execute procedure checkinout();

static/css/attendance.css

-16
This file was deleted.

static/css/camera.css

-66
This file was deleted.

static/css/capture.css

-63
This file was deleted.

static/css/fonts/FontAwesome.otf

-61.4 KB
Binary file not shown.
-37.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)