A lightweight Gradio-based application to browse a directory of images, draw binary scribble masks over them, and save those masks for later use (e.g., segmentation, annotation).
-
Clone this repository
git clone https://github.com/yourusername/image-scribble-editor.git cd image-scribble-editor
-
Install dependencies in an environment
python3 -m venv venv source venv/bin/activate pip install -r requirements.txt
Requires:
gradio
,Pillow
,numpy
-
Prepare your images
Place all your source images in
[path_to_dataset]/images/
. Example:[path_to_dataset]/images/cat1.jpg [path_to_dataset]/images/dog2.png
-
Run the editor
python main.py --datapath [path_to_dataset]
--datapath
points to the folder containing the two subfoldersimages/
andalpha/
.- If
alpha/
does not exist, it will be created automatically.
-
Draw and save
- Use the left‐right arrows to navigate between images.
- Draw scribbles in the left “Draw Scribbles” panel.
- Click Save Scribbles to export a mask (
alpha/imagename.png
) and update the overlay on the right.
dataset-root/
├── images/ # Put your source images here (png/jpg/jpeg/bmp)
└── alpha/ # Mask output directory (created automatically)