This is the backend of the Dr.Smart app. The API processes images for diagnoses and manges the database.
- First there are some environemt vaiables you need. you will find them in
.env.template.txt
- Install the requirements
pip install -r requirements.txt
- Now you can run it
python run.py
If you added the SKIN_MODEL_ID
, and LUNG_MODEL_ID
env vars, the models will get downloaded, then the app will start. If you didn't add them, and didn't download the models, then the app will probably crash.
The SKIN_MODEL_ID
, and the LUNG_MODEL_ID
are the IDs of the tensorflow models on Google Drive.
The endpoints receive data as FormData and respondes on JSON.
email : string
password : string
full_name : string
is_doctor : int
field_id : int
{
"status": true,
"email": "email",
"token": "token",
"user": {
"is_doctor": true,
"field_id": 1,
"name": "name"
}
}
email : string
password : string
{
"status": true,
"email": "email",
"token": "token",
"user": {
"is_doctor": true,
"field_id": 1,
"name": "name"
}
}
{
"status": true,
"data": {
"fields": [
{
"id": 1,
"name": "Nursing"
}
]
}
}
id : int (id of the disease)
type : int (0 == skin, 1 == lung)
{
"status": true,
"data": {
"fields": [
{
"id": 1,
"name": "Nursing"
}
]
}
}
img : image file
type : int (0 == sking, 1 == lung)
{
"data": {
"result": [
{
"confidence": 99.99731779098511,
"id": 3,
"name": "virus"
}
]
},
"status": true
}
limit : int (default = 10)
page : int (default = 1)
{
"status": true,
"data": {
"posts": [
{
"answered": false,
"desc": "some desc",
"field": "Nursing",
"img": null,
"post_id": 19,
"user_name": "some user"
}
]
}
}
{
"status": true,
"data": {
"post":
{
"answered": false,
"desc": "some desc",
"field": "Nursing",
"img": null,
"post_id": 19,
"user_name": "some user"
}
}
}
limit : int (default = 10)
page : int (default = 1)
{
"status": true,
"data": {
"comments": [
{
"comment_id": 18,
"img": null,
"text": "jgjh",
"user_id": 18,
"user_name": "test user"
},
]
}
}
desc: string
field_id: int
img: image file (optional)
{
"status": true,
"post_id": 6
}
text: string
img: image file (optional)
{
"status": true,
"comment_id": 15
}
{
"status": true,
"post_id": 6
}