File tree Expand file tree Collapse file tree 11 files changed +31
-16
lines changed
Expand file tree Collapse file tree 11 files changed +31
-16
lines changed Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ labelme # just open gui
9898cd examples/tutorial
9999labelme apc2016_obj3.jpg # specify image file
100100labelme apc2016_obj3.jpg --output annotations/ # save annotation JSON files to a directory
101- labelme apc2016_obj3.jpg --nodata # not include image data but relative image path in JSON file
101+ labelme apc2016_obj3.jpg --with-image-data # include image data in JSON file
102102labelme apc2016_obj3.jpg \
103103 --labels highland_6539_self_stick_notes,mead_index_cards,kong_air_dog_squeakair_tennis_ball # specify label list
104104
Original file line number Diff line number Diff line change 44## Usage
55
66``` bash
7- labelme data_annotated --labels labels.txt --nodata -- autosave
7+ labelme data_annotated --labels labels.txt --autosave
88```
99
1010![ ] ( .readme/annotation.jpg )
Original file line number Diff line number Diff line change 44## Usage
55
66``` bash
7- labelme data_annotated --flags flags.txt --nodata
7+ labelme data_annotated --flags flags.txt
88```
99
1010<img src =" .readme/annotation_cat.jpg " width =" 100% " />
Original file line number Diff line number Diff line change 33## Annotation
44
55``` bash
6- labelme data_annotated --labels labels.txt --nodata -- validatelabel exact --config ' {shift_auto_shape_color: -2}'
7- labelme data_annotated --labels labels.txt --nodata -- labelflags ' {.*: [occluded, truncated], person: [male]}'
6+ labelme data_annotated --labels labels.txt --validatelabel exact --config ' {shift_auto_shape_color: -2}'
7+ labelme data_annotated --labels labels.txt --labelflags ' {.*: [occluded, truncated], person: [male]}'
88```
99
1010![ ] ( .readme/annotation.jpg )
Original file line number Diff line number Diff line change 33## Annotation
44
55``` bash
6- labelme data_annotated --labels labels.txt --nodata -- validatelabel exact --config ' {shift_auto_shape_color: -2}'
6+ labelme data_annotated --labels labels.txt --validatelabel exact --config ' {shift_auto_shape_color: -2}'
77```
88
99![ ] ( .readme/annotation.jpg )
Original file line number Diff line number Diff line change 44## Annotation
55
66``` bash
7- labelme data_annotated --labels labels.txt --nodata -- keep-prev --config ' {shift_auto_shape_color: -2}'
7+ labelme data_annotated --labels labels.txt --keep-prev --config ' {shift_auto_shape_color: -2}'
88```
99
1010<img src =" .readme/00000100.jpg " width =" 49% " /> <img src =" .readme/00000101.jpg " width =" 49% " />
Original file line number Diff line number Diff line change @@ -122,10 +122,10 @@ def main():
122122 )
123123 # config for the gui
124124 parser .add_argument (
125- "--nodata " ,
126- dest = "store_data " ,
127- action = "store_false " ,
128- help = "stop storing image data to JSON file" ,
125+ "--with-image-data " ,
126+ dest = "with_image_data " ,
127+ action = "store_true " ,
128+ help = "store image data in JSON file" ,
129129 default = argparse .SUPPRESS ,
130130 )
131131 parser .add_argument (
Original file line number Diff line number Diff line change @@ -341,7 +341,7 @@ def __init__(
341341 slot = self .enableSaveImageWithData ,
342342 tip = self .tr ("Save image data in label file" ),
343343 checkable = True ,
344- checked = self ._config ["store_data " ],
344+ checked = self ._config ["with_image_data " ],
345345 )
346346
347347 close = action (
@@ -1522,7 +1522,7 @@ def format_shape(s):
15221522 try :
15231523 assert self .imagePath
15241524 imagePath = osp .relpath (self .imagePath , osp .dirname (filename ))
1525- imageData = self .imageData if self ._config ["store_data " ] else None
1525+ imageData = self .imageData if self ._config ["with_image_data " ] else None
15261526 if osp .dirname (filename ) and not osp .exists (osp .dirname (filename )):
15271527 os .makedirs (osp .dirname (filename ))
15281528 lf .save (
@@ -1931,7 +1931,7 @@ def scaleFitWidth(self):
19311931 return w / self .canvas .pixmap .width ()
19321932
19331933 def enableSaveImageWithData (self , enabled ):
1934- self ._config ["store_data " ] = enabled
1934+ self ._config ["with_image_data " ] = enabled
19351935 self .actions .saveWithImageData .setChecked (enabled )
19361936
19371937 def closeEvent (self , a0 : QtGui .QCloseEvent ) -> None :
Original file line number Diff line number Diff line change @@ -41,6 +41,10 @@ def _migrate_config_from_file(config_from_yaml: dict) -> None:
4141 )
4242 config_from_yaml ["keep_prev_brightness_contrast" ] = True
4343
44+ if "store_data" in config_from_yaml :
45+ logger .info ("Migrating old config: store_data -> with_image_data" )
46+ config_from_yaml ["with_image_data" ] = config_from_yaml .pop ("store_data" )
47+
4448 if config_from_yaml .get ("shortcuts" , {}).pop ("add_point_to_edge" , None ):
4549 logger .info ("Migrating old config: removing shortcuts.add_point_to_edge" )
4650
@@ -68,8 +72,8 @@ def get_user_config_file(create_if_missing: bool = True) -> str:
6872 "# https://github.com/wkentaro/labelme/blob/main/labelme/config/default_config.yaml\n "
6973 "#\n "
7074 "# Example:\n "
75+ "# with_image_data: true\n "
7176 "# auto_save: true\n "
72- "# store_data: false\n "
7377 "# labels: [cat, dog]\n "
7478 )
7579 except Exception :
Original file line number Diff line number Diff line change 11auto_save : false
22display_label_popup : true
3- store_data : true
3+ with_image_data : false
44keep_prev : false
55keep_prev_scale : false
66keep_prev_brightness_contrast : false
You can’t perform that action at this time.
0 commit comments