You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-7Lines changed: 9 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -38,15 +38,17 @@ pip install .
38
38
39
39
### Quick start
40
40
41
-
Pass the labels and image directory on the command line to start labelling. Use the on-screen buttons to select a label for the current image and advance to the next one. Number keys correspond to labels and can be used instead.
41
+
Simplabel can be started from the command line without any argument:
42
+
```
43
+
simplabel
44
+
```
45
+
You will be prompted to select a directory containing images to label. Add labels with the '+' button and start labeling. Number keys correspond to labels and can be used instead.
42
46
47
+
The target directory and/or labels can also be passed directly from the command line:
43
48
```
44
49
simplabel --labels dog cat bird --directory path/to/image/directory
45
50
```
46
51
47
-
Note that simplabel can now be called without any arguments as follows: `simplabel`.
48
-
The user will be prompted to select an image directory and labels can be added with the + button at the bottom of the screen.
49
-
50
52
After the first use, labels are stored in `labels.pkl` and the `--labels` argument is ignored.
51
53
52
54
### Command line arguments
@@ -56,9 +58,9 @@ After the first use, labels are stored in `labels.pkl` and the `--labels` argume
56
58
-`-u, --user <USERNAME>` sets the username. Defaults to the OS login name if none is passed.
57
59
-`-r, --redundant` does not display other labelers selections for independent labelling. Reconciliation and Make Master are unavailable in this mode.
58
60
-`-v, --verbose` increases the verbosity level.
59
-
-`--remove-label` tries to safely remove a label from the list saved in `labels.pkl`.
61
+
-`--remove-label <LABEL>` tries to safely remove a label from the list saved in `labels.pkl` (must also pass `-d`)
60
62
-`--reset-lock` overrides the lock preventing the same username from being used multiple times simultaneously.
61
-
-`--delete-all` removes all files created by simplabel in the directory
63
+
-`--delete-all` removes all files created by simplabel in the directory (must also pass `-d`)
62
64
63
65
### Multiuser
64
66
@@ -82,7 +84,7 @@ with open("labeled_user1.pkl","rb") as f:
82
84
Once you are done labelling, use the flow_to_directory tool to copy images to distinct directories by label
ap.add_argument("-i", "--input-directory", default=os.getcwd(), help="Path of the directory containing the raw images and labeled.pkl file. Defaults to current directory")
65
+
ap.add_argument("-o", "--output-directory", help="Path of the output directory, will be created if it does not exist")
ap.add_argument("-u", "--user", help="Set username for the current session")
1062
+
ap.add_argument("-r", "--redundant", action='store_true', help="Redundant mode: do not show other labeler's selections")
1063
+
ap.add_argument("--delete-all", action='store_true', help="Deletes all files created by simplabel in a directory, this resets the labels and all saved data")
1064
+
ap.add_argument("--reset-lock", action='store_true', help="Overrides the lock in case of incorrect lockout")
1065
+
ap.add_argument("--remove-label", help="Remove a label from the list")
1066
+
1067
+
args=ap.parse_args()
1068
+
1069
+
# Get the variables from parser
1070
+
rawDirectory=args.directory
1071
+
categories=args.labels
1072
+
verbosity=args.verbose
1073
+
username=args.user
1074
+
bResetLock=args.reset_lock
1075
+
bRedundant=args.redundant
1076
+
1077
+
# Reset all saved data if requested
1078
+
ifargs.delete_all:
1079
+
delete_all_files(rawDirectory)
1080
+
sys.exit(0)
1081
+
1082
+
# Remove label
1083
+
ifargs.remove_label:
1084
+
ifnotrawDirectory:
1085
+
print("No directory specified. You must pass the directory containing the label file with -d")
0 commit comments