Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dominic248/django-docker

Tech-Stack: Django, Django-REST-Framework, Docker, Firebase-db Hosted Django API (with Docker and Heroku). Face Training API with firebase-db, Face Recognition API with firebase-db, Image Color Transfer API, Sudoku Solver API, Sudoku Extractor API
https://github.com/dominic248/django-docker

django django-rest-framework docker

Last synced: 6 days ago
JSON representation

Tech-Stack: Django, Django-REST-Framework, Docker, Firebase-db Hosted Django API (with Docker and Heroku). Face Training API with firebase-db, Face Recognition API with firebase-db, Image Color Transfer API, Sudoku Solver API, Sudoku Extractor API

Awesome Lists containing this project

README

        

# Django in Docker
## Docker file for Django with OpenCV-4 and dlib
### Create Docker Image
```
docker build -t -f Dockerfile .
```
### Run Docker Image
```
docker run -it -p 8888:8888
```

---

## Setting up Django API Project for Face Recognition (first time only)
```
virtualenv -p python3.6 env
source ./env/bin/activate
sudo apt-get install cmake
pip install -r requirements.txt
```

---

## Running the Django API Project for Face Recognition
```
source ./env/bin/activate
python src/manage.py runserver
```

---

## Creating a public server for Django API project
Download [ngrok](https://ngrok.com/) and extract files on your PC and export the path to ngrok file to the System Environment PATH variable and run
```
ngrok http 8000
```
You'll get a link to access the Django API Project outside the home network.

---

## API endpoints: https://delta24-mini-django-api-v1.herokuapp.com/

NOTE



  1. Use 100x100 image dimension on these endpoints to avoid memory leak, due to large numpy array. (For face training and face recognition API's)

  2. Server sleeps after 30 minutes of inactivity and will take time to restart on new requests after 30 minutes of inactivity.


### **Face Training API:**
> **API endpoint:** ```/face_detection/train/firebase/```

> **Method:** POST

> **Parameters:**

> 1. **```image```**

> **Type:** Image

> **Alternative:** ```url``` (Image URL)

> **Description:** Single image file with 1 person in image.
> 2. **```name```**

> **Type:** String

> **Description:** Name of the person.
> 3. **```resume```** (optional)

> **Type:** Boolean

> **Description:** Resume training or overwrite all previous trainings.

### **Face Recognition API:**
> **API endpoint:** ```/face_detection/detect/firebase/```

> **Method:** POST

> **Parameters:**

> 1. **```image```**

> **Type:** Image

> **Alternative:** ```url``` (Image URL)

> **Description:** Single image file with 1 person in image.

### **Color Transfer API:**
> **API endpoint:** ```/colortransfer/```

> **Method:** POST

> **Parameters:**

> 1. **```source_url```**

> **Type:** Image

> **Alternative:** ```source_url``` (Image URL)

> **Description:** Single image file or URL of image.
> 2. **```target_image```**

> **Type:** Image

> **Alternative:** ```target_url``` (Image URL)

> **Description:** Single image file or URL of image.
> 3. **```json```**

> **Type:** Boolean

> **Description:** To get image as Base64 URL set it as ```true``` and for Image response set it as ```false```.

### **Sudoku Solver API:**
> **API endpoint:** ```/sudoku/solver/```

> **Method:** POST

> **Parameters:**

> 1. **```sudoku```**

> **Type:** 2D-Array/List

> **Description:** 2D-Array/List, with blank cells of sudoku filled with 0.

### **Sudoku Extractor API:**
> **API endpoint:** ```/sudoku/extractor/```

> **Method:** POST

> **Parameters:**

> 1. **```image```**

> **Type:** Image

> **Alternative:** ```url``` (Image URL)

> **Description:** Single image file with a cropped sudoku puzzle.