Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
DA-Platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
文档服务地址:
http://47.92.0.57:3000/
周报索引地址:
http://47.92.0.57:3000/s/NruNXRYmV
Open sidebar
Berlin
DA-Platform
Commits
b94623d7
Commit
b94623d7
authored
Jun 22, 2020
by
convivae
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
image
parent
9b81eec9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
16 deletions
+55
-16
Image.py
DAPlatform/Dao/Image.py
+0
-0
app.py
DAPlatform/app.py
+10
-1
config.py
DAPlatform/config/config.py
+18
-0
requirements.txt
DAPlatform/requirements.txt
+5
-0
imageAnnotation.py
DAPlatform/views/imageAnnotation.py
+22
-15
No files found.
DAPlatform/Dao/Image.py
View file @
b94623d7
This diff is collapsed.
Click to expand it.
DAPlatform/app.py
View file @
b94623d7
from
flask
import
Flask
from
flask_cors
import
CORS
from
dao
import
Image
# from views.uploadDownload import uploadDownload
# from views.textAnnotation import textAnnotation
from
views.user
import
user
from
views.task
import
task
from
views.slice
import
slice
from
views.imageAnnotation
import
image
from
config.config
import
DevelopmentConfig
app
=
Flask
(
__name__
)
CORS
(
app
)
app
.
config
.
from_object
(
DevelopmentConfig
)
Image
.
db
.
init_app
(
app
)
# app.register_blueprint(textAnnotation)
# app.register_blueprint(uploadDownload)
app
.
register_blueprint
(
user
)
app
.
register_blueprint
(
task
)
app
.
register_blueprint
(
slice
)
app
.
register_blueprint
(
image
)
if
__name__
==
'__main__'
:
app
.
run
(
debug
=
True
,
host
=
'127.0.0.1'
,
port
=
9100
)
DAPlatform/config/config.py
0 → 100644
View file @
b94623d7
# 配置文件
import
os
class
DevelopmentConfig
(
object
):
"""Base config class."""
# Flask app config
DEBUG
=
False
TESTING
=
False
SECRET_KEY
=
"sample_key"
# Root path of project
PROJECT_PATH
=
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'..'
))
# MongoEngine config
MONGODB_SETTINGS
=
{
"db"
:
"test"
,
'host'
:
'localhost'
,
'port'
:
27017
}
DAPlatform/requirements.txt
View file @
b94623d7
...
...
@@ -48,6 +48,8 @@ fastcache==1.0.2
filelock==3.0.8
Flask==1.0.2
Flask-Cors==3.0.8
flask-mongoengine==0.9.5
Flask-WTF==0.14.3
gevent==1.3.6
glob2==0.6
greenlet==0.4.15
...
...
@@ -92,6 +94,7 @@ menuinst==1.4.14
mistune==0.8.3
mkl-fft==1.0.4
mkl-random==1.0.1
mongoengine==0.20.0
more-itertools==4.3.0
mpmath==1.0.0
msgpack==0.5.6
...
...
@@ -143,6 +146,7 @@ pycurl==7.43.0.2
pyflakes==2.0.0
Pygments==2.2.0
pylint==2.1.1
pymongo==3.10.1
PyMySQL==0.9.3
pyodbc==4.0.24
pyOpenSSL==18.0.0
...
...
@@ -206,6 +210,7 @@ win-inet-pton==1.0.1
win-unicode-console==0.5
wincertstore==0.2
wrapt==1.10.11
WTForms==2.3.1
xlrd==1.1.0
XlsxWriter==1.1.0
xlwings==0.11.8
...
...
DAPlatform/views/imageAnnotation.py
View file @
b94623d7
import
json
from
flask
import
Blueprint
from
flask
import
request
from
flask
import
Blueprint
,
jsonify
,
request
from
..D
ao
import
Image
from
d
ao
import
Image
image
=
Blueprint
(
"image"
,
__name__
,
url_prefix
=
""
)
# 获取图片
@image.route
(
"/image"
,
methods
=
[
"GET"
])
def
get_image
():
relation_list
=
request
.
args
.
get
(
'relationList'
)
data
=
json
.
loads
(
request
.
data
)
relation_list
=
data
[
'relationList'
]
image
=
Image
.
getImage
(
relation_list
)
res
=
{
'code'
:
image
.
code
,
...
...
@@ -19,9 +20,11 @@ def get_image():
return
json
.
dumps
(
res
)
# 保存图片标注结果
@image.route
(
"/image"
,
methods
=
[
"POST"
])
def
save_image
():
image_list
=
request
.
args
.
get
(
'imageList'
)
data
=
json
.
loads
(
request
.
data
)
image_list
=
data
[
'imageList'
]
ret
=
Image
.
saveImage
(
image_list
)
res
=
{
'code'
:
ret
.
code
,
...
...
@@ -31,23 +34,27 @@ def save_image():
return
json
.
dumps
(
res
)
# 获取图层
@image.route
(
"/layer"
,
methods
=
[
"GET"
])
def
get_fragment
():
relation_list
=
request
.
args
.
get
(
'relationList'
)
fragment
=
Image
.
getFragment
(
relation_list
)
def
get_layer
():
data
=
json
.
loads
(
request
.
data
)
relation_list
=
data
[
'relationList'
]
layer
=
Image
.
getLayer
(
relation_list
)
res
=
{
'code'
:
fragment
.
code
,
'message'
:
fragment
.
message
,
'data'
:
fragment
.
data
'code'
:
layer
.
code
,
'message'
:
layer
.
message
,
'data'
:
layer
.
data
}
return
json
.
dumps
(
res
)
# 保存图层标注结果
@image.route
(
"/layer"
,
methods
=
[
"POST"
])
def
save_fragment
():
fragment_list
=
request
.
args
.
get
(
'layerList'
)
mark_list
=
request
.
args
.
get
[
'markList'
]
ret
=
Image
.
saveFragment
(
fragment_list
,
mark_list
)
def
save_layer
():
data
=
json
.
loads
(
request
.
data
)
layer_list
=
data
[
'layerList'
]
landmark_list
=
data
[
'landmarkList'
]
ret
=
Image
.
saveLayer
(
layer_list
,
landmark_list
)
res
=
{
'code'
:
ret
.
code
,
'message'
:
ret
.
message
,
...
...
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