1. Set the default autosave
It's not easy to mark a data every time, but when clicking on the next image, you still need to click Save manually, or you need to set automatic save every time you open labelme software. It's cumbersome and inconvenient. Small partners can set the automatic save option to true in labelme's configuration file
Open the file / users / viatorsun / Labelmerc, first line
auto_save: true
2. Automatically load labels txt
If a small partner has been labeling a dataset for a long time, its label is the same, but it is too inefficient to input it every time. Therefore, it can be set through the following two methods. In this way, each time you open the label me, the label written in advance will be automatically loaded in the label list, which is pleasant both physically and mentally 😊!
Method 1:
Open lableme installation folder "/ library / frameworks / python.framework/versions/3.8/lib/python3.8/site-packages/label / _. Py", find the following code and change the settings
parser.add_argument( "--labels", help="comma separated list of labels OR file containing labels", default= argparse.SUPPRESS, # Replace with labels Txt absolute address ) # argparse. Support means that no value is used
Method 2:
Enter the instruction in terminal, which is required every time
labelme --labels "./labels.txt" # labels.txt absolute address
3. Shortcut key
shortcuts: close : Ctrl+W open : Ctrl+O open_dir : Ctrl+U quit : Ctrl+Q save : Ctrl+S save_as : Ctrl+Shift+S save_to : null delete_file : Ctrl+Delete open_next : [D, Ctrl+Shift+D] open_prev : [A, Ctrl+Shift+A] zoom_in : [Ctrl++, Ctrl+=] zoom_out : Ctrl+- zoom_to_original : Ctrl+0 fit_window : Ctrl+F fit_width : Ctrl+Shift+F create_polygon : Ctrl+N create_rectangle : Ctrl+R create_circle : null create_line : null create_point : null create_linestrip : null edit_polygon : Ctrl+J delete_polygon : Delete duplicate_polygon : Ctrl+D undo : Ctrl+Z undo_last_point : [Ctrl+Z, Backspace] add_point_to_edge : Ctrl+Shift+P edit_label : Ctrl+E toggle_keep_prev_mode: Ctrl+P
4.1 parameter introduction
Using labelme --help will show how to use labelme, which includes the following parameters
We explain several important parameter settings
- --output: mark the file storage location. If the given parameter is json, a label is written to the file. This means that if used json, only one image can be annotated. If the position is not in At the end of json, the program will assume that it is a directory. Annotations are stored in this directory with a name corresponding to the image on which they are annotated.
- --Flags: create category labels for images. Multiple categories are separated by commas.
- --nosortlabels: whether to sort labels
Example: on the command line, enter labelme image1 png --output image1. json --flags 0,1
Among them, image1 PNG is the address of the image, not the name. Note the difference, because my current path is in the current folder where the image is stored, so you can directly find the image by entering the name. If your current path is not in the folder where the image is stored, you need to give the full path of the image, such as F: \ labelmeimage \ image1 png --output image1.json is to store the tagging results in image1 json in this file. Because I label a single image, so I json end. If you label a folder, don't label it here At the end of json, just enter the folder you want to store-- flags: describe the tags you classify. 0,1 indicates two categories. It can also be written into multiple classes, 0,1,2,3,4 You can also use other characters, such as negative, positive, or cat, dog. Wait~