https://github.com/alvii147/chromatic
Public image repository website, with authentication and facial detection
https://github.com/alvii147/chromatic
django opencv shopify
Last synced: 3 months ago
JSON representation
Public image repository website, with authentication and facial detection
- Host: GitHub
- URL: https://github.com/alvii147/chromatic
- Owner: alvii147
- License: bsd-3-clause
- Created: 2021-09-18T20:46:59.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-10-02T23:21:44.000Z (over 3 years ago)
- Last Synced: 2025-04-28T16:55:53.046Z (about 1 year ago)
- Topics: django, opencv, shopify
- Language: Python
- Homepage: https://devpostman404.pythonanywhere.com/
- Size: 1.89 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/alvii147/chromatic/actions)  [](https://devpostman404.pythonanywhere.com/)
# chromatic
## Overview
*chromatic* is a public image repository website. It allows users to authenticate themselves and upload images. *chromatic* also performs facial detection on uploaded images. This was a part of the **Shopify Fall 2022 Data Engineering Intern Challenge.**
This challenge was completed by building a stand-alone **Django** application. Try out the demo [here](https://devpostman404.pythonanywhere.com/).

In order to upload images of your own, click *Register* on the top left to register for an account, then login to your created account. Once you're logged in, you should see the *Upload Image +* option on the top left, which will lead you to the image uploading page.

Clicking on an individual image will launch a modal that displays the picture, which includes a facial recognition feature built using **OpenCV** and Haar Cascade Classifiers.

## Try it out locally
The instructions below are for running *chromatic* on a local machine.
### Clone the repository
```bash
git clone https://github.com/alvii147/chromatic.git
```
### Install dependencies
```bash
pip3 install -r requirements.txt
```
### Set up environment variables
```bash
export DJANGO_ENV_MODE="DEV"
export SECRET_KEY="qwertyuiopasdfghjklzxcvbnm1234567890"
```
### Run migrations
```bash
cd chromatic
python3 manage.py migrate
```
### Run the server
```bash
python3 manage.py runserver
```
The server should then be up at `http://localhost:8000`.
## Testing
Currently *chromatic* is run through rigorous testing, including unit tests for Django URLs, views, as well as OpenCV functions, under Python 3.7, 3.8, and 3.9 environments. [This Github Actions CI script](.github/workflows/django.yml) is used for automated testing on Github. Currently **100% of tests are passing**, while **test coverage is 82%** (coverage is not perfect due to a few default Django files that are not covered in tests).
### Running tests and coverage
```bash
coverage run --source='.' manage.py test -v 2
coverage report
```
### Coverage Report
```
Name Stmts Miss Cover
--------------------------------------------------------------
chromatic/__init__.py 0 0 100%
chromatic/asgi.py 4 4 0%
chromatic/settings/__init__.py 7 3 57%
chromatic/settings/base.py 24 0 100%
chromatic/settings/dev.py 3 0 100%
chromatic/settings/prod.py 3 3 0%
chromatic/urls.py 6 0 100%
chromatic/wsgi.py 4 4 0%
chromatic_app/__init__.py 0 0 100%
chromatic_app/admin.py 8 0 100%
chromatic_app/apps.py 4 0 100%
chromatic_app/forms.py 8 0 100%
chromatic_app/migrations/0001_initial.py 7 0 100%
chromatic_app/migrations/__init__.py 0 0 100%
chromatic_app/models.py 19 2 89%
chromatic_app/tests/__init__.py 0 0 100%
chromatic_app/tests/test_urls.py 19 0 100%
chromatic_app/tests/test_utils.py 16 1 94%
chromatic_app/tests/test_views.py 20 0 100%
chromatic_app/urls.py 4 0 100%
chromatic_app/utils.py 18 3 83%
chromatic_app/views.py 36 18 50%
manage.py 12 2 83%
--------------------------------------------------------------
TOTAL 222 40 82%
```