Skip to content

CIRS-Girona/MILF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minimalistic Image Labelling Framework (MILF)

A tkinter-based, minimalistic utility for pixel-wise image annotation with support for SAM-based prompting.

Prerequisites

The file requirements.txt contains the necessary Python packages for this project. To install, run:

pip install -r requirements.txt

Next, download SAM vit_b model checkpoint from their GitHub repository, and place it in the assets directory.

assets/sam_vit_b_01ec64.pth

To start the application, run the main script from the project root:

python3 main.py

Alternatively, self-contained executables built via PyInstaller are available on the Releases page for Windows and macOS. These builds can be directly executed without a local Python environment or external dependencies.

Usage

  1. Load the dataset

    Select the directory containing image files (.png, .jpg, .jpeg, .tiff, .npy), followed by a .csv file containing the color map. Ensure that the color map is properly formatted: Label,HexCode. For example,

    Target,ff0000
    Background,ffffff
  2. Optionally load masks

    Select the directory containing existing masks for updating.

  3. Select mode

    • Polygon: Draw polygons with left-click, and fill regions with right-click, or fill the entire image with return.
    • Brush: Paint freehand masks using adjustable brush size.
    • Prompt: Place positive (left-click) and negative (right-click) points to prompt SAM for automatic prompt generation.
  4. Additional Features

    • Use Left / Right arrow keys to navigate between images in the directory .
    • Use Up / Down arrow keys to zoom in and out.
    • Ctrl+Click on a pixel to copy its class ID; useful for replacing or updating annotated segments.
    • Optionally enter textual comments/notes for each image.
    • A .log file is generated to track annotation progress.
  5. Save annotations

    Masks are saved as .png files in a subdirectory called segmented/ within the image directory. Textual comments, if any, are stored in .txt files corresponding to each image.

Citation

If you find this repository useful, please consider giving us a star ⭐

@misc{rajani2025benthicat,
    title={BenthiCat: An opti-acoustic dataset for advancing benthic classification and habitat mapping},
    author={Hayat Rajani and Valerio Franchi and Borja Martinez-Clavel Valles and Raimon Ramos and Rafael Garcia and Nuno Gracias},
    year={2025},
    eprint={2510.04876},
    archivePrefix={arXiv},
    primaryClass={cs.CV}
}

About

Minimalistic Image Labelling Framework (MILF): A simple utility for pixel-wise image annotations.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages