Skip to content

Commit

Permalink
nov 11
Browse files Browse the repository at this point in the history
  • Loading branch information
thinhphanuark committed Nov 11, 2024
1 parent 74b7175 commit b8dccf1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 4 additions & 1 deletion labelme/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,10 @@ def setDirty(self):
# Even if we autosave the file, we keep the ability to undo
self.actions.undo.setEnabled(self.canvas.isShapeRestorable)
if self._config["auto_save"] or self.actions.saveAuto.isChecked():
label_file = osp.splitext(self.imagePath)[0] + ".json"
if self.imagePath == self.filename:
label_file = osp.splitext(self.imagePath)[0] + ".json"
else:
label_file = osp.splitext(self.filename)[0] + ".json"
if self.output_dir:
label_file_without_path = osp.basename(label_file)
label_file = osp.join(self.output_dir, label_file_without_path)
Expand Down
5 changes: 3 additions & 2 deletions labelme/config/default_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ label_colors: [
2: [ 0, 128, 0],
3: [128, 128, 0],
4: [ 0, 0, 128],
5: [128, 0, 128],
5: [128, 0, 192],
6: [ 0, 128, 128],
7: [128, 128, 128],
8: [128, 64, 128],
Expand Down Expand Up @@ -57,7 +57,7 @@ label_colors: [
34: [ 0, 128, 64],
35: [128, 128, 64],
36: [ 0, 0, 192],
37: [128, 0, 192],
37: [128, 0, 128],
38: [ 0, 128, 192],
39: [128, 128, 192],
40: [ 64, 0, 64],
Expand Down Expand Up @@ -382,3 +382,4 @@ shortcuts:
show_all_polygons: null
hide_all_polygons: null
toggle_all_polygons: T

0 comments on commit b8dccf1

Please sign in to comment.