Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
Skin disease Server
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Skin disease
Skin disease Server
Commits
03b7cf73
Commit
03b7cf73
authored
Sep 21, 2021
by
Kavindu Randika
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Symptoms API
parent
a50b22a1
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
2 deletions
+41
-2
README.md
README.md
+1
-1
config/data.json
config/data.json
+1
-0
main.py
main.py
+2
-1
requirements.txt
requirements.txt
+0
-0
routes/prediction.py
routes/prediction.py
+37
-0
No files found.
README.md
View file @
03b7cf73
...
...
@@ -11,7 +11,7 @@
## run Server
-
.
\e
nv
\S
cripts
\a
ctivate
-
uvicorn
index
:app --reload
-
uvicorn
main
:app --reload
## Export Dependencies
...
...
config/data.json
0 → 100644
View file @
03b7cf73
{
"23,2,8,9,11,12,68,15"
:
"Acne Symptoms"
,
"4,28,0,0,0,0,0,0"
:
"Rosacea Symptoms"
,
"53,32,6,21,39,0,0,0"
:
"actinic keratosis symptoms"
,
"84,81,82,72,85,0,0,0"
:
"Atopic dermatitis"
,
"37,42,55,27,0,0,0,0"
:
"Bullous disease symptoms"
,
"49,61,63,46,67,31,51,16"
:
"Cellulitis Symptoms"
,
"86,76,73,78,0,0,0,0"
:
"Eczema Symptoms"
,
"33,10,30,57,0,0,0,0"
:
"Exanthems Symptoms"
,
"56,47,34,70,7,5,0,0"
:
"Alopecia symptoms"
,
"75,71,45,13,0,0,0,0"
:
"Herpes HPV symptoms"
,
"79,77,74,83,0,0,0,0"
:
"Light Disease Symptoms"
,
"44,48,20,35,60,41,43,0"
:
"lupus symptoms"
,
"1,18,22,3,29,0,0,0"
:
"melanoma symptoms"
,
"66,69,19,25,14,59,0,0"
:
"Nail Fungus symptoms"
,
"52,40,61,17,24,0,0,0"
:
"poison ivy symptoms"
,
"50,58,26,38,65,62,0,0"
:
"psoriasis symptoms"
,
"36,80,54,64,0,0,0,0"
:
"Scabies symptoms"
}
\ No newline at end of file
main.py
View file @
03b7cf73
from
fastapi
import
FastAPI
from
routes.disease
import
disease
from
routes.doctor
import
doctor
from
routes.prediction
import
prediction
app
=
FastAPI
()
app
.
include_router
(
disease
)
app
.
include_router
(
doctor
)
app
.
include_router
(
prediction
)
requirements.txt
View file @
03b7cf73
B
asgiref
==3.4.1
...
...
routes/prediction.py
0 → 100644
View file @
03b7cf73
from
typing
import
List
from
fastapi
import
APIRouter
from
os
import
error
import
pandas
as
pd
import
numpy
as
np
import
json
import
os
prediction
=
APIRouter
()
def
load_data_json
(
path
=
''
):
with
open
(
path
,
'r'
)
as
fp
:
data
=
json
.
load
(
fp
)
fp
.
close
()
return
data
@
prediction
.
get
(
'/api/predictions/symptoms'
)
async
def
predict_symptoms
():
try
:
data
=
load_data_json
(
'../config/data.json'
)
threshold
=
0.5
input
=
set
([
79
,
77
])
output
=
[]
for
key
in
data
.
keys
():
numbers
=
[
int
(
i
)
for
i
in
key
.
split
(
','
)
if
int
(
i
)
!=
0
]
lenght
=
len
(
numbers
)
score
=
len
(
list
(
input
&
set
(
numbers
)))
/
lenght
if
score
>=
threshold
:
output
.
append
(
data
.
get
(
key
))
return
{
"success"
:
True
,
"result"
:
output
}
except
error
:
return
{
"success"
:
False
,
"msg"
:
error
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment