DatasetAutomaticLabeler (DAL) is a tool designed to automatically generate dataset annotations for computer vision tasks. It is based on samurai, a zero-shot visual tracker, with some upgrades in order to easily label any type of dataset.
It is not intended (for now) as a professional tool, but it can drastically help in the process of labeling of videos.
It uses YOLO .txt format to save labels.
Author: Marco Lo Pinto [GitLab]
It is imperative to use Conda. You've been warned 💡
-
Create a Conda environment and activate it:
conda create -n dal_labeller python=3.10
conda activate dal_labeller
-
Install all sam2 necessary packages:
cd samurai/sam2 pip install -e . pip install -e ".[notebooks]"
-
Install other requirements:
pip install matplotlib==3.7 tikzplotlib jpeg4py opencv-python lmdb pandas scipy loguru
-
Install Conda-only packages:
conda install pillow==11.1.0 matplotlib==3.10.0
-
Install GUI package:
pip install napari
-
Download the model from one of these links:
It is reccomended to download the large.
-
Rename it accordingly and put it in the folder samurai/sam2/checkpoints.
That's it!
Note: If it's your first time using Conda and you can't install packages when working, remember to set your .crt file with this command:
conda config --set ssl_verify <path_to_cert>.crtIn general, the path is /etc/ssl/certs/ca-bundle.crt
Activate the Conda environment if you are not in it:
conda activate dal_labellerStart the program with:
python labeller_gui.pyA window will appear, like that, where you have to select the folder in which the frames of the video are present:
Then, select also the labels folder (i.e., the folder in which to save, for each image, its corresponding label):
Then a GUI will appear, where you can draw your first bounding box:
First of all, in order to move between frames, use the left and right arrow kyes or the slider:
when you want to label the first frame that will be propagated, select the "Bounding Box" layer, like so:
then press the "square" button (i.e., the blue button in the image):
and then draw your bounding box. If you are not satisfied with your result, press the "x" button and try again. When you are satisfied, close the window and the automatic labeller will start.
If you want to skip completely the step of selecting images and labels file, you can do:
python labeller_gui.py --images path/to/imagesand it will automatically use "path/to/images" as the images folder path, and "path/to/labels" as the output labels path.
This repository includes the samurai repository as a git subtree under the samurai/ directory, initialized as follows:
git remote add samurai_remote https://github.com/yangchris11/samurai.git
git fetch samurai_remote
git subtree add --prefix=samurai samurai_remote master --squashIf for some reason, you want to update the samurai repo, do:
git fetch samurai_remote
git subtree pull --prefix=samurai samurai_remote master --squashBUT BEWARE OF CONFLICTING CHANGES.
Contributions are welcome!





