Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
labelme
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
jakambs
labelme
Commits
c7442b77
Commit
c7442b77
authored
Mar 31, 2018
by
Kentaro Wada
Browse files
Options
Downloads
Patches
Plain Diff
Overwrite existing label file with importDir
parent
cc7ffeb8
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
labelme/app.py
+1
-1
1 addition, 1 deletion
labelme/app.py
labelme/labelFile.py
+3
-0
3 additions, 0 deletions
labelme/labelFile.py
with
4 additions
and
1 deletion
labelme/app.py
+
1
−
1
View file @
c7442b77
...
@@ -917,7 +917,7 @@ class MainWindow(QMainWindow, WindowMixin):
...
@@ -917,7 +917,7 @@ class MainWindow(QMainWindow, WindowMixin):
if
self
.
hasLabels
():
if
self
.
hasLabels
():
if
self
.
labelFile
:
if
self
.
labelFile
:
# DL20180323 - overwrite when in directory
# DL20180323 - overwrite when in directory
self
.
_saveFile
(
self
.
saveFileDialog
()
)
self
.
_saveFile
(
self
.
labelFile
.
filename
)
elif
self
.
output
:
elif
self
.
output
:
self
.
_saveFile
(
self
.
output
)
self
.
_saveFile
(
self
.
output
)
else
:
else
:
...
...
This diff is collapsed.
Click to expand it.
labelme/labelFile.py
+
3
−
0
View file @
c7442b77
...
@@ -38,6 +38,7 @@ class LabelFile(object):
...
@@ -38,6 +38,7 @@ class LabelFile(object):
self
.
imageData
=
None
self
.
imageData
=
None
if
filename
is
not
None
:
if
filename
is
not
None
:
self
.
load
(
filename
)
self
.
load
(
filename
)
self
.
filename
=
filename
def
load
(
self
,
filename
):
def
load
(
self
,
filename
):
try
:
try
:
...
@@ -61,6 +62,7 @@ class LabelFile(object):
...
@@ -61,6 +62,7 @@ class LabelFile(object):
self
.
imageData
=
imageData
self
.
imageData
=
imageData
self
.
lineColor
=
lineColor
self
.
lineColor
=
lineColor
self
.
fillColor
=
fillColor
self
.
fillColor
=
fillColor
self
.
filename
=
filename
except
Exception
as
e
:
except
Exception
as
e
:
raise
LabelFileError
(
e
)
raise
LabelFileError
(
e
)
...
@@ -78,6 +80,7 @@ class LabelFile(object):
...
@@ -78,6 +80,7 @@ class LabelFile(object):
try
:
try
:
with
open
(
filename
,
'
wb
'
if
PY2
else
'
w
'
)
as
f
:
with
open
(
filename
,
'
wb
'
if
PY2
else
'
w
'
)
as
f
:
json
.
dump
(
data
,
f
,
ensure_ascii
=
True
,
indent
=
2
)
json
.
dump
(
data
,
f
,
ensure_ascii
=
True
,
indent
=
2
)
self
.
filename
=
filename
except
Exception
as
e
:
except
Exception
as
e
:
raise
LabelFileError
(
e
)
raise
LabelFileError
(
e
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment