Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2022-018
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
1
Merge Requests
1
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
2022-018
2022-018
Commits
d02e72cf
Commit
d02e72cf
authored
Nov 13, 2022
by
Kavinda K.D.J.D. IT19106984
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
APi calls
parent
dded03e6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
0 deletions
+42
-0
main_image.py
main_image.py
+42
-0
No files found.
main_image.py
0 → 100644
View file @
d02e72cf
import
numpy
as
np
from
flask
import
Flask
,
jsonify
,
request
,
render_template
from
pyexpat
import
model
from
xmlrpc.client
import
boolean
from
flask
import
Flask
import
pickle
from
flask_cors
import
CORS
,
cross_origin
from
flask_restful
import
Api
,
Resource
import
imageDiseaseAPI
app
=
Flask
(
__name__
)
@
app
.
route
(
"/image_disease"
,
methods
=
[
"GET"
])
# def prediction(api_data):
def
prediction
():
# image1 = request.get_json()
image1
=
'image_name_5'
# print(image1)
#Disease = imageDiseaseAPI.predict(image1)
Disease
=
imageDiseaseAPI
.
predict
()
if
Disease
==
'[[0.27964538 0.25150934 0.04603015 0.04416401 0.03723199 0.026214990.03327395 0.2819302 ]]'
:
discount
=
10
elif
Disease
==
'[[0.27964538 0.25150934 0.04603015 0.04416401 0.03723199 0.02621499
\n
0.03327395 0.2819302 ]]'
:
discount
=
5
elif
Disease
==
'[[0.27964538 0.25150934 0.04603015 0.04416401 0.03723199 0.02621499
\n
0.03327395 0.2819302 ]]'
:
discount
=
2
else
:
discount
=
0
return
jsonify
(
discount
)
if
__name__
==
'__main__'
:
app
.
run
(
debug
=
True
)
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