Simple UI for the model: Segment anything from Facebook.
Segment anything UI for annotations
- Install segment-anything python package from Github: Segment anything.
- Download checkpoint Checkpoint and put it into workspace folder.
- Fill default_path in config.py.
- Install requirements.txt.
pip install -r requirements.txt
. export PYTHONPATH=$PYTHONPATH:.
.python segment_anything_ui/main_window.py
.
Currently, for saving a simple format is used: mask is saved as .png file, when masks are represented by values: 1 ... n and corresponding labels are saved as jsons. In json, labels are a map with mapping: MASK_ID: LABEL. MASK_ID is the id of the stored mask and LABEL is one of "labels.json" files.
Button | Description | Shortcut |
---|---|---|
Add Points | Mouse click will add positive (left) or negative (right) point. | A |
Add Box | Mouse click will add a box. | Q |
Annotate All | Runs regular grid annotation with parameters from the form | Enter |
Pick Mask | Pick mask when clicking on it. Cycling through masks if pixel belongs to multiple masks. | X |
Merge Masks | WIP: Merge masks when clicking on them. Cycling through masks if pixel belongs to multiple masks. | Z |
Move Current Mask to Front | Use current mask as background (less important) | None |
Cancel Annotation | Cancel current annotation | C |
Save Annotation | Save current annotation | N |
Manual Polygon | Draw polygon with mouse | M |
---- | ---- | ---- |
Open Files | Load files from the folder | None |
Next File | Load next image | F |
Previous File | Load previous image | T |
---- | ---- | ---- |
Precompute All Embeddings | Currently not implemented | None |
Show Image | Currently not implemented | None |
Show Visualization | Currently not implemented | None |
- - FIX: mouse picker for small objects is not precise.
- - Region merging.
- - Manual annotation.
- - Saving and loading of masks.
- - Class support for assigning classes to objects.
- - Add object borders.
- - Fix mask size and QLabel size for precise mouse clicks.
- - Draft mask when no points are visible.