Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

✏️ DAL: DatasetAutomaticLabeler

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]

🚀 Installation

It is imperative to use Conda. You've been warned 💡

  1. Create a Conda environment and activate it:

    conda create -n dal_labeller python=3.10
    conda activate dal_labeller
  2. Install all sam2 necessary packages:

    cd samurai/sam2
    pip install -e .
    pip install -e ".[notebooks]"
  3. Install other requirements:

    pip install matplotlib==3.7 tikzplotlib jpeg4py opencv-python lmdb pandas scipy loguru
  4. Install Conda-only packages:

    conda install pillow==11.1.0 matplotlib==3.10.0
  5. Install GUI package:

    pip install napari
  6. Download the model from one of these links:

    It is reccomended to download the large.

  7. 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>.crt

In general, the path is /etc/ssl/certs/ca-bundle.crt

🕹️ Usage

Activate the Conda environment if you are not in it:

conda activate dal_labeller

Start the program with:

python labeller_gui.py

A 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/images

and it will automatically use "path/to/images" as the images folder path, and "path/to/labels" as the output labels path.

📜 Notes

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 --squash

If for some reason, you want to update the samurai repo, do:

git fetch samurai_remote
git subtree pull --prefix=samurai samurai_remote master --squash

BUT BEWARE OF CONFLICTING CHANGES.

Contributions are welcome!

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages