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
8b012439
Commit
8b012439
authored
Aug 03, 2020
by
convivae
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imageUrl->imageName
parent
2e67275e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
Image.py
DAPlatform/dao/Image.py
+4
-4
imageAnnotation.py
DAPlatform/views/imageAnnotation.py
+2
-2
No files found.
DAPlatform/dao/Image.py
View file @
8b012439
...
@@ -52,12 +52,12 @@ class Label(db.EmbeddedDocument):
...
@@ -52,12 +52,12 @@ class Label(db.EmbeddedDocument):
class
Image
(
db
.
Document
):
class
Image
(
db
.
Document
):
relationId
=
db
.
IntField
(
required
=
True
,
unique
=
True
)
relationId
=
db
.
IntField
(
required
=
True
,
unique
=
True
)
# photo = db.FileField()
# photo = db.FileField()
image
Url
=
db
.
StringField
(
required
=
True
)
image
Name
=
db
.
StringField
(
required
=
True
)
labelList
=
db
.
ListField
(
db
.
EmbeddedDocumentField
(
Label
))
labelList
=
db
.
ListField
(
db
.
EmbeddedDocumentField
(
Label
))
def
to_json
(
self
):
def
to_json
(
self
):
return
{
'relationId'
:
self
.
relationId
,
return
{
'relationId'
:
self
.
relationId
,
'image
Url'
:
self
.
imageUrl
,
'image
Name'
:
self
.
imageName
,
'labelList'
:
[
i
.
to_json
()
for
i
in
self
.
labelList
]
'labelList'
:
[
i
.
to_json
()
for
i
in
self
.
labelList
]
}
}
...
@@ -99,7 +99,7 @@ def create_images(image_list):
...
@@ -99,7 +99,7 @@ def create_images(image_list):
delete_image
(
rid
)
delete_image
(
rid
)
image
=
Image
(
image
=
Image
(
relationId
=
i
[
'relationId'
],
relationId
=
i
[
'relationId'
],
image
Url
=
i
[
'imageUrl
'
],
image
Name
=
i
[
'imageName
'
],
labelList
=
create_labels
(
i
[
'labelList'
])
labelList
=
create_labels
(
i
[
'labelList'
])
)
)
image
.
save
()
image
.
save
()
...
@@ -112,7 +112,7 @@ def get_img_name(relation_id):
...
@@ -112,7 +112,7 @@ def get_img_name(relation_id):
img
=
Image
.
objects
(
relationId
=
relation_id
)
.
first
()
img
=
Image
.
objects
(
relationId
=
relation_id
)
.
first
()
if
img
is
None
:
if
img
is
None
:
raise
Exception
(
"relation id = {} 的图片不存在"
.
format
(
relation_id
))
raise
Exception
(
"relation id = {} 的图片不存在"
.
format
(
relation_id
))
return
img
[
'image
Url
'
]
.
split
(
'/'
)[
-
1
]
return
img
[
'image
Name
'
]
.
split
(
'/'
)[
-
1
]
# 根据 relationId 删除图片
# 根据 relationId 删除图片
...
...
DAPlatform/views/imageAnnotation.py
View file @
8b012439
...
@@ -202,7 +202,7 @@ def export_kml(relationId):
...
@@ -202,7 +202,7 @@ def export_kml(relationId):
# "imageList": [
# "imageList": [
# {
# {
# "relationId": 123,
# "relationId": 123,
# "image
Url
": "tom@qq.com",
# "image
Name
": "tom@qq.com",
# "labelList": [
# "labelList": [
# {
# {
# "labelId": 123,
# "labelId": 123,
...
@@ -219,7 +219,7 @@ def export_kml(relationId):
...
@@ -219,7 +219,7 @@ def export_kml(relationId):
# },
# },
# {
# {
# "relationId": 156,
# "relationId": 156,
# "image
Url
": "jerry@qq.com",
# "image
Name
": "jerry@qq.com",
# "labelList": [
# "labelList": [
# {
# {
# "labelId": 13,
# "labelId": 13,
...
...
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