Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
不会修仙的道士
labelme
提交
c33e4496
L
labelme
项目概览
不会修仙的道士
/
labelme
与 Fork 源项目一致
从无法访问的项目Fork
通知
4
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
labelme
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
c33e4496
编写于
1月 24, 2020
作者:
K
Kentaro Wada
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove fill color
上级
025ed3d7
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
0 addition
and
60 deletion
+0
-60
labelme/app.py
labelme/app.py
+0
-53
labelme/config/default_config.yaml
labelme/config/default_config.yaml
+0
-1
labelme/label_file.py
labelme/label_file.py
+0
-6
未找到文件。
labelme/app.py
浏览文件 @
c33e4496
...
...
@@ -18,7 +18,6 @@ from labelme.config import get_config
from
labelme.label_file
import
LabelFile
from
labelme.label_file
import
LabelFileError
from
labelme.logger
import
logger
from
labelme.shape
import
DEFAULT_FILL_COLOR
from
labelme.shape
import
Shape
from
labelme.widgets
import
Canvas
from
labelme.widgets
import
ColorDialog
...
...
@@ -253,9 +252,6 @@ class MainWindow(QtWidgets.QMainWindow):
close
=
action
(
'&Close'
,
self
.
closeFile
,
shortcuts
[
'close'
],
'close'
,
'Close current file'
)
color2
=
action
(
'Polygon &Fill Color'
,
self
.
chooseColor2
,
shortcuts
[
'edit_fill_color'
],
'color'
,
self
.
tr
(
'Choose polygon fill color'
))
toggle_keep_prev_mode
=
action
(
self
.
tr
(
'Keep Previous Annotation'
),
...
...
@@ -416,11 +412,6 @@ class MainWindow(QtWidgets.QMainWindow):
self
.
tr
(
'Modify the label of the selected polygon'
),
enabled
=
False
)
shapeFillColor
=
action
(
self
.
tr
(
'Shape &Fill Color'
),
self
.
chshapeFillColor
,
icon
=
'color'
,
tip
=
self
.
tr
(
'Change the fill color for this specific shape'
),
enabled
=
False
)
fill_drawing
=
action
(
self
.
tr
(
'Fill Drawing Polygon'
),
self
.
canvas
.
setFillDrawing
,
...
...
@@ -446,7 +437,6 @@ class MainWindow(QtWidgets.QMainWindow):
changeOutputDir
=
changeOutputDir
,
save
=
save
,
saveAs
=
saveAs
,
open
=
open_
,
close
=
close
,
deleteFile
=
deleteFile
,
fillColor
=
color2
,
toggleKeepPrevMode
=
toggle_keep_prev_mode
,
delete
=
delete
,
edit
=
edit
,
copy
=
copy
,
undoLastPoint
=
undoLastPoint
,
undo
=
undo
,
...
...
@@ -457,7 +447,6 @@ class MainWindow(QtWidgets.QMainWindow):
createLineMode
=
createLineMode
,
createPointMode
=
createPointMode
,
createLineStripMode
=
createLineStripMode
,
shapeFillColor
=
shapeFillColor
,
zoom
=
zoom
,
zoomIn
=
zoomIn
,
zoomOut
=
zoomOut
,
zoomOrg
=
zoomOrg
,
fitWindow
=
fitWindow
,
fitWidth
=
fitWidth
,
zoomActions
=
zoomActions
,
...
...
@@ -475,8 +464,6 @@ class MainWindow(QtWidgets.QMainWindow):
None
,
addPointToEdge
,
None
,
color2
,
None
,
toggle_keep_prev_mode
,
),
# menu shown at right click
...
...
@@ -491,7 +478,6 @@ class MainWindow(QtWidgets.QMainWindow):
edit
,
copy
,
delete
,
shapeFillColor
,
undo
,
undoLastPoint
,
addPointToEdge
,
...
...
@@ -617,7 +603,6 @@ class MainWindow(QtWidgets.QMainWindow):
self
.
imagePath
=
None
self
.
recentFiles
=
[]
self
.
maxRecent
=
7
self
.
fillColor
=
None
self
.
otherData
=
None
self
.
zoom_level
=
100
self
.
fit_window
=
False
...
...
@@ -649,9 +634,6 @@ class MainWindow(QtWidgets.QMainWindow):
# self.restoreGeometry(settings['window/geometry']
self
.
restoreState
(
self
.
settings
.
value
(
'window/state'
,
QtCore
.
QByteArray
()))
self
.
fillColor
=
QtGui
.
QColor
(
self
.
settings
.
value
(
'fill/color'
,
Shape
.
fill_color
))
Shape
.
fill_color
=
self
.
fillColor
# Populate the File menu dynamically.
self
.
updateFileMenu
()
...
...
@@ -971,7 +953,6 @@ class MainWindow(QtWidgets.QMainWindow):
self
.
actions
.
delete
.
setEnabled
(
n_selected
)
self
.
actions
.
copy
.
setEnabled
(
n_selected
)
self
.
actions
.
edit
.
setEnabled
(
n_selected
==
1
)
self
.
actions
.
shapeFillColor
.
setEnabled
(
n_selected
)
def
addLabel
(
self
,
shape
):
item
=
QtWidgets
.
QListWidgetItem
(
shape
.
label
)
...
...
@@ -1004,7 +985,6 @@ class MainWindow(QtWidgets.QMainWindow):
for
shape
in
shapes
:
label
=
shape
[
'label'
]
points
=
shape
[
'points'
]
fill_color
=
shape
[
'fill_color'
]
shape_type
=
shape
[
'shape_type'
]
flags
=
shape
[
'flags'
]
...
...
@@ -1013,9 +993,6 @@ class MainWindow(QtWidgets.QMainWindow):
shape
.
addPoint
(
QtCore
.
QPointF
(
x
,
y
))
shape
.
close
()
if
fill_color
:
shape
.
fill_color
=
QtGui
.
QColor
(
*
fill_color
)
default_flags
=
{}
if
self
.
_config
[
'label_flags'
]:
for
pattern
,
keys
in
self
.
_config
[
'label_flags'
].
items
():
...
...
@@ -1042,8 +1019,6 @@ class MainWindow(QtWidgets.QMainWindow):
def
format_shape
(
s
):
return
dict
(
label
=
s
.
label
.
encode
(
'utf-8'
)
if
PY2
else
s
.
label
,
fill_color
=
s
.
fill_color
.
getRgb
()
if
s
.
fill_color
!=
self
.
fillColor
else
None
,
points
=
[(
p
.
x
(),
p
.
y
())
for
p
in
s
.
points
],
shape_type
=
s
.
shape_type
,
flags
=
s
.
flags
...
...
@@ -1069,7 +1044,6 @@ class MainWindow(QtWidgets.QMainWindow):
imageData
=
imageData
,
imageHeight
=
self
.
image
.
height
(),
imageWidth
=
self
.
image
.
width
(),
fillColor
=
self
.
fillColor
.
getRgb
(),
otherData
=
self
.
otherData
,
flags
=
flags
,
)
...
...
@@ -1267,8 +1241,6 @@ class MainWindow(QtWidgets.QMainWindow):
osp
.
dirname
(
label_file
),
self
.
labelFile
.
imagePath
,
)
if
self
.
labelFile
.
fillColor
is
not
None
:
self
.
fillColor
=
QtGui
.
QColor
(
*
self
.
labelFile
.
fillColor
)
self
.
otherData
=
self
.
labelFile
.
otherData
else
:
self
.
imageData
=
LabelFile
.
load_image_file
(
filename
)
...
...
@@ -1370,7 +1342,6 @@ class MainWindow(QtWidgets.QMainWindow):
self
.
settings
.
setValue
(
'window/size'
,
self
.
size
())
self
.
settings
.
setValue
(
'window/position'
,
self
.
pos
())
self
.
settings
.
setValue
(
'window/state'
,
self
.
saveState
())
self
.
settings
.
setValue
(
'fill/color'
,
self
.
fillColor
)
self
.
settings
.
setValue
(
'recentFiles'
,
self
.
recentFiles
)
# ask the use for where to save the labels
# self.settings.setValue('window/geometry', self.saveGeometry())
...
...
@@ -1615,18 +1586,6 @@ class MainWindow(QtWidgets.QMainWindow):
def
currentPath
(
self
):
return
osp
.
dirname
(
str
(
self
.
filename
))
if
self
.
filename
else
'.'
def
chooseColor2
(
self
):
color
=
self
.
colorDialog
.
getColor
(
self
.
fillColor
,
self
.
tr
(
'Choose fill color'
),
default
=
DEFAULT_FILL_COLOR
)
if
color
:
self
.
fillColor
=
color
Shape
.
fill_color
=
self
.
fillColor
self
.
canvas
.
update
()
self
.
setDirty
()
def
toggleKeepPrevMode
(
self
):
self
.
_config
[
'keep_prev'
]
=
not
self
.
_config
[
'keep_prev'
]
...
...
@@ -1645,18 +1604,6 @@ class MainWindow(QtWidgets.QMainWindow):
for
action
in
self
.
actions
.
onShapesPresent
:
action
.
setEnabled
(
False
)
def
chshapeFillColor
(
self
):
color
=
self
.
colorDialog
.
getColor
(
self
.
fillColor
,
self
.
tr
(
'Choose fill color'
),
default
=
DEFAULT_FILL_COLOR
)
if
color
:
for
shape
in
self
.
canvas
.
selectedShapes
:
shape
.
fill_color
=
color
self
.
canvas
.
update
()
self
.
setDirty
()
def
copyShape
(
self
):
self
.
canvas
.
endMove
(
copy
=
True
)
self
.
labelList
.
clearSelection
()
...
...
labelme/config/default_config.yaml
浏览文件 @
c33e4496
...
...
@@ -81,5 +81,4 @@ shortcuts:
undo_last_point
:
[
Ctrl+Z
,
Backspace
]
add_point_to_edge
:
Ctrl+Shift+P
edit_label
:
Ctrl+E
edit_fill_color
:
Ctrl+Shift+L
toggle_keep_prev_mode
:
Ctrl+P
labelme/label_file.py
浏览文件 @
c33e4496
...
...
@@ -59,7 +59,6 @@ class LabelFile(object):
'version'
,
'imageData'
,
'imagePath'
,
'fillColor'
,
'shapes'
,
# polygonal annotations
'flags'
,
# image level flags
'imageHeight'
,
...
...
@@ -83,12 +82,10 @@ class LabelFile(object):
data
.
get
(
'imageHeight'
),
data
.
get
(
'imageWidth'
),
)
fillColor
=
data
[
'fillColor'
]
shapes
=
[
dict
(
label
=
s
[
'label'
],
points
=
s
[
'points'
],
fill_color
=
s
[
'fill_color'
],
shape_type
=
s
.
get
(
'shape_type'
,
'polygon'
),
flags
=
s
.
get
(
'flags'
,
{}),
)
...
...
@@ -107,7 +104,6 @@ class LabelFile(object):
self
.
shapes
=
shapes
self
.
imagePath
=
imagePath
self
.
imageData
=
imageData
self
.
fillColor
=
fillColor
self
.
filename
=
filename
self
.
otherData
=
otherData
...
...
@@ -136,7 +132,6 @@ class LabelFile(object):
imageHeight
,
imageWidth
,
imageData
=
None
,
fillColor
=
None
,
otherData
=
None
,
flags
=
None
,
):
...
...
@@ -153,7 +148,6 @@ class LabelFile(object):
version
=
__version__
,
flags
=
flags
,
shapes
=
shapes
,
fillColor
=
fillColor
,
imagePath
=
imagePath
,
imageData
=
imageData
,
imageHeight
=
imageHeight
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录