The PTSafe backend is created in order to support the main functionalities that are covered in the PTSafe mobile application (can be found here in PTSafe mobile). It consists of two main backend framework developed on top of Flask and NodeJS, and it is connected to the data source Amazon Web Services (AWS) RDS. While the Flask API is utilised to expose the crowd detection model, the NodeJS-Express API is utilised to expose the main data source for the application. To support the deployment process, both backend APIs are served in AWS Elastic Beanstalk link Platform-as-a-service (PaaS) hosting service.
The back-end object detection part of the application is established by using a Flask API framework based on python. It is expected at this point that all API endpoint creation is generated by using a functional programming paradigm rather than Object-Oriented Principle (OOP) to speed up the development process.
Meanwhile, the model is developed by using YOLOv3 computer vision black-box, and achieve an accuracy of nearly 90% for each edge cases.
- click (7.1.2)
- Flask (1.1.2)
- gunicorn (20.0.4)
- itsdangerous (1.1.0)
- Jinja2 (2.11.2)
- MarkupSafe (1.1.1)
- numpy (1.18.4)
- opencv-python (4.2.0.34)
- scipy (1.4.1)
- Werkzeug (1.0.1)
Endpoint | Request Method | Request param | Request body | functionalities |
---|---|---|---|---|
http://ptsafeyoloapi-env-1.eba-2wtk3jqk.us-east-1.elasticbeanstalk.com/v1/predict | POST | none | file (JPG, PNG) | detect number of people inside a carriage |
Some steps are required to run this application locally on your computer machine:
- Fork this repository to your own machine
- Install required packages including Flask, Python, etc
- Happy exploring!
- master (is merged with the iteration-2 branch)