Skip to content

lsscecilia/IoT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

61d43f3 · May 4, 2022

History

9 Commits
Feb 25, 2022
Feb 26, 2022
Feb 26, 2022
Feb 26, 2022
Feb 26, 2022
May 4, 2022
Feb 26, 2022

Repository files navigation

IOT project

This repo includes the app (client) and the server that is hosted on google cloud.

This app is able to take photo and give a prediction of what the object is.

Usage

Download iot.apk and install in android device.

Client

Develop in android studio

Server

This is a flask backend server

Deploy on cloud

http://34.87.129.213:5000/ update: it is not hosted now due to $$ charges from google cloud

To send POST request to server

RequestParam: predict/file=image.jpg

Example: postman api test

Guide to deploy on cloud: https://www.section.io/engineering-education/deploy-flask-to-gce/ (remember to configure firewall)

To run locally

python3 server.py

OR

export FLASK_APP="server.py"
flask run -p 5000

Localhost: http://0.0.0.0:5000/

Depencies

pillow
flask
tensorflow (note: for mac m1 chip, have to create virtual env)

References

https://cloud.google.com/compute/docs/quickstart-linux https://loopj.com/android-async-http/ https://github.com/android-async-http/android-async-http https://developer.android.com/training/camera/photobasics https://educative.io/edpresso/extracting-an-apk-file-from-android-studio https://stackoverflow.com/questions/45046001/how-to-configure-action-image-capture-to-store-the-photo-in-public-external-stor https://stackoverflow.com/questions/29339565/how-do-i-call-rest-api-from-an-android-app https://towardsdatascience.com/how-to-build-a-machine-learning-api-using-flask-2fb345518801