Skip to content

Commit

Permalink
bs5
Browse files Browse the repository at this point in the history
  • Loading branch information
Husseinfo committed Mar 31, 2024
1 parent 3aee6ed commit d3d9632
Showing 64 changed files with 556 additions and 1,947 deletions.
4 changes: 0 additions & 4 deletions .gitattributes

This file was deleted.

3 changes: 1 addition & 2 deletions .github/workflows/django.yml
Original file line number Diff line number Diff line change
@@ -8,12 +8,11 @@ on:

jobs:
build:

runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [ '3.10' ]
python-version: [ '3.11' ]

steps:
- uses: actions/checkout@v3
18 changes: 0 additions & 18 deletions .github/workflows/docker-image.yml

This file was deleted.

16 changes: 0 additions & 16 deletions .github/workflows/pages.yml

This file was deleted.

35 changes: 12 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# tracker

![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)
A face recognition based attendance system.

![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)
[![GitHub license](https://img.shields.io/github/license/husseinfo/tracker.svg)](https://github.com/husseinfo/tracker/blob/main/LICENSE)
[![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)
[![GitHub stars](https://img.shields.io/github/stars/husseinfo/tracker.svg)](https://github.com/husseinfo/tracker/stargazers)
@@ -10,35 +12,22 @@
- [OpenCV](https://github.com/opencv/opencv) replaced
with [face_recognition](https://github.com/ageitgey/face_recognition/)
- Upgraded to [Django 4](https://github.com/django/django/releases/tag/4.0.6)
- UI with [django-bootstrap5](https://github.com/zostera/django-bootstrap5)

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

## Overview

A face recognition based attendance system.

## Functionalities

- Login
- Homepage: showing last stats of the system
- Add user: to add new faces
- Capture page: to take faces photos from a local or remote device
- Train page: to train models
- Attendance page: shows attendance records
- A RESTful API interface to send attendance records (from the raspberry pi in the prototype device)

## Environment
## Running

Python == 3.10
Python 3.11

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

## Running

Initialize the database from django:
Initialize the database:

- ```python manage.py migrate```
- ```python manage.py createsuperuser```
```bash
python manage.py migrate
python manage.py createsuperuser
```

Start the server:
Run development server:
```python manage.py runserver```
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.10-slim
FROM python:3.11-alpine

WORKDIR /opt

1 change: 0 additions & 1 deletion docs/index.md

This file was deleted.

11 changes: 0 additions & 11 deletions mkdocs.yml

This file was deleted.

3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Django==4.1.13
djangorestframework==3.14.0
face_recognition==1.3.0
scikit-learn==1.1.3
mkdocs-material==8.5.9
django-bootstrap5==23.4
47 changes: 26 additions & 21 deletions sql/inoutTrigger.sql
Original file line number Diff line number Diff line change
@@ -1,34 +1,39 @@
-- auto-generated definition
create function checkinout() returns trigger
language plpgsql
language plpgsql
as $$
BEGIN
IF new.inout IS NOT NULL
IF
new.inout IS NOT NULL
THEN
RETURN NULL;
END IF;
IF (SELECT COUNT(*)
FROM tracker_attendance
WHERE user_id = new.user_id AND date :: DATE = now() :: DATE) = 0
END IF;
IF
(
SELECT COUNT(*)
FROM tracker_attendance
WHERE user_id = new.user_id
AND date :: DATE = now() :: DATE) = 0
THEN
new.inout := TRUE;
ELSEIF (SELECT DISTINCT ON (date) inout
FROM tracker_attendance
WHERE user_id = new.user_id
ORDER BY date DESC)
ELSEIF
(
SELECT DISTINCT
ON (date) inout
FROM tracker_attendance
WHERE user_id = new.user_id
ORDER BY date DESC)
THEN
new.inout := FALSE;
ELSE
new.inout := FALSE;
ELSE
new.inout := TRUE;
END IF;
RETURN NULL;
END IF;
RETURN NULL;
END
$$
;
$$;

create trigger checkinouttrigger
before insert
on tracker_attendance
for each row
execute procedure checkinout()
;
before insert
on tracker_attendance
for each row
execute procedure checkinout();
16 changes: 0 additions & 16 deletions static/css/attendance.css

This file was deleted.

66 changes: 0 additions & 66 deletions static/css/camera.css

This file was deleted.

63 changes: 0 additions & 63 deletions static/css/capture.css

This file was deleted.

Binary file removed static/css/fonts/FontAwesome.otf
Binary file not shown.
Binary file removed static/css/fonts/fontawesome-webfont.eot
Binary file not shown.
Loading

0 comments on commit d3d9632

Please sign in to comment.