Tanamin Web Service is a web service that allows you to predict the disease of plant by uploading image of plant leaf. This service is under development and will be updated soon. First three features are available is Cassava leaves disease prediction, Rice leaves disease prediction and Vegetable types classification.
The first thing you need to know is that this service is using authentication to access each service. You need to login to access the service. The login is using username and password. You can register on the registration service. Please don't spam the registration service because it will make the registration service slow. If you have some idea to secure this service, please contact me.
Base url of this service is: http://localhost:5000/
The service available:
-
Authentications
POST /authentications
PUT /authentications
DEL /authentications
-
Users
GET /users/{userId}
POST /users
PUT /users/{userId}
DEL is not avalable now
-
Predictions
POST /predictions/cassava
POST /predictions/rice
POST /predictions/tomato
-
History
GET /predict/historys/
GET /predict/historys/{historyId}
GET /predict/historys/plant/{plantId}/
GET /predict/historys/plant/{plantId}/disease/{diseaseId}
POST /histories
DEL /histories/{historyId}
-
Classifications
POST /classifications/vegetable
-
Plant
GET /plants
POST /plants
PUT /plants/{plantId}
GET /plants/{plantId}
DEL /plants/{plantId}
-
Diseases
GET /diseases
POST /diseases
PUT /diseases/{diseaseId}
GET /diseases/{diseaseId}
DEL /diseases/{diseaseId}
-
Vegetables
GET /vegetables
POST /vegetables
PUT /vegetables/{vegetableId}
GET /vegetables/{vegetableId}
DEL /vegetables/{vegetableId}
This service is using token for authentication. You should have an account to access this service. First if you don't have an account, create a new account. Then, create a token for authentication. It's like login, you need to authenticate yourself with username and password. If the autentication is valid, you will get a token. You can use this token to access the service. If dont, you will get a error message.
The token given is accessToken and refreshToken. The refreshToken is used to refresh the token. The accessToken is valid for 30 minutes. If you want to refresh the token, you need to send the refreshToken to the service. If the refreshToken is valid, you will get a new accessToken. If the refreshToken is not valid, you will get a error message.
The predictions service is using imgUrl and endpoint id to retrieve predictions. The endpoint id is used to define what model to be used. So you should know what endpoint id you want to use. The endpoint id is:
- cassava leaf : 4257194673539383296
- rice leaf : 2528938316535955456
- tomato leaf : 9197643464764817408
For the imgUrl, it is image url that publicly accessible. The image should be in image format like (jpg, png, jpeg, etc.). The image url can be obtained when you upload your image to upload picture service, or search on google.
If the prediction is successful, you will get a json object. The json object contains the prediction result. The prediction result contains the highest probability and the predicted class, with some additional information related to the class. The result will be stored as a history object.
This service is like predictions service withoud storing the result as a history object. The result will be lost imedietely after the process. The endpoint id is:
- vegetables : 5666821356906348544
In order to run this project, you need to configure the following environment variables:
#development
HOST= {your application host, localhost if development}
NODE_ENV = {your environment server}
PORT= {your server port}
# node-postgres configuration
PGUSER= {your database username}
PGHOST= {your database host}
PGPASSWORD= {your database password}
PGDATABASE= {your database name}
PGPORT= {your database port}
PGURI= {your database uri if available}
# JWT Token Key
ACCESS_TOKEN_KEY= {define your own token key}
REFRESH_TOKEN_KEY= {define your own refresh token}
ACCESS_TOKEN_AGE = {define how long the access token is valid}
# AI platform
PROJECT_ID={your project id}
Then you can use the following image to create your own database:
Databases ERD
This Web service uses Postman to test.
- You can download the Postman documentation here.
If you want to contribute to this project, please contact me.
I'd be happy to review any pull requests that may better the TanamIn project, in particular if you have a bug fix, enhancement, or a new idea, you can contact us.
CC member is responsible for the development of the API service and deployment of the model. In sort, in this project CC is responsible for Backend, infrastructure, and DevOps.
Shazi Awaludin
ML Member is who are contribute to create prediction and classification model that used in this web service. Without them, this service is nothing.
MD member is who are responsible to serve mobile applications based on Android and use this service as data source and more.