Package: simplabel
SimplabelGraphical tool to manually label images in distinct categories to build training datasets.
Simply pass a list of categories, a directory containing images and start labelling.
Supports multiple users, reconciliation and keyboard bindings to label even faster!InstallationInstall with pipSimplabel is on PyPI so it can be installed with pippip install simplabelInstall from sourceClone the repository to your computergit clone https://github.com/hlgirard/Simplabel.gitand install with pipcd Simplabel
pip install .UsageQuick startSimplabel can be started from the command line without any argument:simplabelYou 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.The target directory and/or labels can also be passed directly from the command line:simplabel --labels dog cat bird --directory path/to/image/directoryAfter the first use, labels are stored inlabels.pkland the--labelsargument is ignored.Command line arguments-d, --directory <PATH/TO/DIRECTORY>sets the directory to search for images and save labels to. Defaults to the current working directory.-l, --labels <label1 label2 label3 ...>sets the categories for the labelling task. Only passed on the first use in a given directory.-u, --user <USERNAME>sets the username. Defaults to the OS login name if none is passed.-r, --redundantdoes not display other labelers selections for independent labelling. Reconciliation and Make Master are unavailable in this mode.-v, --verboseincreases the verbosity level.--remove-label <LABEL>tries to safely remove a label from the list saved inlabels.pkl(must also pass-d)--reset-lockoverrides the lock preventing the same username from being used multiple times simultaneously.--delete-allremoves all files created by simplabel in the directory (must also pass-d)MultiuserThe app relies on the filesystem to save each user's selection and display other user's selections. It works best if the working directory is on a shared drive or in a synced folder (Dropbox, Onedrive...). The Reconcile workflow allows any user to see and resolve conflicts. The Make Master option can be used to create and save a master dictionary -labeled_master.pkl- containing all labeled images (after reconciliation).Import saved labelsThe app saves alabeled_<username>.pklfile that contains a pickeled dictionary {image_name: label}. To import the dictionary, use the following sample code:importpicklewithopen("labeled_user1.pkl","rb")asf:label_dict=pickle.load(f)Advanced usageUtilitiesOnce you are done labelling, use the flow_to_directory tool to copy images to distinct directories by labelflow_to_directory --input-directory data/labeled --output-directory data/sortedPython objectThe Tkinter app can also be started from a python environmentfromsimplabelimportImageClassifierimporttkinterastkroot=tk.Tk()directory="data/raw"categories=['dog','cat','bird']MyApp=ImageClassifier(root,directory,categories)tk.mainloop()LicenseThis project is licensed under the GPLv3 License - see theLICENSE.mdfile for details.AcknowledgementsTesting of tkinter GUI is based on ivan_pozdeev's answer at Stackoverflow:https://stackoverflow.com/questions/4083796/how-do-i-run-unittest-on-a-tkinter-app