Home

Awesome

MuViLab

MUltiple VIdeos LABelling tool is a manual annotation tool to help you labelling videos for computer vision, machine learning, deep learning and AI applications. With MuViLab you can annotate hours of videos in just a few minutes!

Key features

Once you annotate your videos, you can use any stardard library like Tensorflow to train your algorithm.

Why use MuViLab?

Several hours of repetitive video

Immagine you've got days or months of video recording from some source (e.g. video surveillance, health monitoring, weather webcam...) and you're interested in an algorithm that classifies a specific event (e.g. a red car crosses the street, a thunder in the sky...). With standard annotation tools, you have to watch the entire video to observe and label the event. Sometimes, the event you're annotating is so quick that you cannot even speed up your videos, requiring you to watch them at normal speed.

With MuViLab, you can split your long video into short clips of 3-4 seconds, which are shown simultaneously in loop on screen. With a single glance, you'll be able to identify your event in ~100 clips, speeding up your job by almost 100 times!

<link rel="img_src" href="doc/media/annotate.gif" />

Click to annotate

After annotating your videos, you can use the review function to check and modify your labels: Review annotations

Installation

Simply install the following required pagackes:

$ pip install opencv-python numpy pytube tqdm matplotlib

and run the demo:

$ python examples/example_youtube_olympics.py

The pytube package is only needed to download a youtube video to run the demo.

Basic usage

To start MuViLab, simply import the class Annotator into your script and set up the labels and the folder containing the video clips. Labels must be a list of dictionaries in the form of {'name': 'My_Label', 'color': (255, 255, 255)}, where 'name' is your custom name for each annotation and 'color' is a BGR colour triplet in the interval [0, 255]. The method .video_to_clips() allows you to convert a long video into several short clips. If you already have several clips to annotate, skip this step and simply run main():

from annotator import Annotator
# Define the labels
labels = [{'name': 'text_of_label_1', 'color': (0, 255, 0)},
        {'name': 'text_of_label_2', 'color': (0, 0, 255)},
        {'name': 'text_of_label_3', 'color': (0, 255, 255)}]
# Initialise MuViLab
clips_folder = './clips'
annotator = Annotator(labels, clips_folder, annotation_file='my_labels.json')
# Split the main video into clips
annotator.video_to_clips('long_video.mp4', clips_folder, clip_length=90, overlap=0, resize=0.5)
# Run the GUI
annotator.main()

Clips order

The video clips are shown in a vertical order from the top left to the bottom right corner: Video clips order

Keyboard commands

While running, the following keyboard commands will be accepted by the GUI:

Labels will be automatically saved when changing page or quitting the program.

A status file will also be saved including the last video that was labelled. Future runs of the application will start from the last annotated page.

Advanced usage

Additional parameters can be set when initialising Annotator:

MuViLab is designed to work with several short-length clips. You can use the method .video_to_clips() to convert a single long video into several custom-length clips. The method takes the following arguments as input:

Once video clips are generated, every next usage of MuViLab does not need to call .video_to_clips() again.

License

MuViLab was developed while working for the SPHERE IRC project. MuViLab is freely available for free non-commercial use, and may be redistributed under these conditions. For commercial queries, please contact me.