Video labeling software with KCF tracker.
Default In/Out Label Format: YOLO
yolo format: class, centerX, centerY, box width, box height
(all in percentages of image size)
*Note: Labeler assumes that all images are the same size
After downloading the repository, open the project in Qt Creator. Then apply the following configurations:
cmake .
make
./VideoLabeler path_to_images {class_number}
*Note: class_number must be a int and all classes must be continuous for combineLabels.py to work
./VideoLabeler path_to_images {class_number} {secondary_class_number}
If the output_file specified already contains ROIs, these will be loaded up into the labeler.
Drawing ROIs is done clicking and holding the LMB on the image. This is enabled after pressing w or r
r Will draw an ROI on the current frame and start tracking for following frames. If the following frames have ANY ROIs already set, those ROIs will be deleted.
w Will draw an ROI but the following frames will not track. This does not affect any other frames.
The following keys will stop the tracking until r is used again: w x b h
Key | Action |
---|---|
y u | Increase/Decrease up delay between frames |
h j | Go backwards/forwards one frame |
r | Reset (destructive marking). Draws ROI on frame and starts tracker for following frames |
t | Show/Hide info panel |
Esc | Finish labeling |
Key | Action (These actions also stops the tracker on the next frame) |
h | Go backwards |
w | Non-destructive marking. Draws ROI on frame but stops tracker |
x | Mark frame without object |
b | Move to beginning |
Key | Action |
---|---|
space | Pause/Play |
z | Save current ROIs to file |
To combine all class labels into an individual file
python combineLabels {image_directory} {num_of_classes}
Once all labels are combined you can check the bounding boxes using
python checkLabels {image_directory}
Choose option 0 to check labels, and remove any wrongly labeled files. Warning this will completely remove the image and it's associated labels. Removing labels (as well as the images) will prevent the labeller from working on the existing images
python checkLabels {image_directory}
Choose option 1
To generate images from a video, use ffmpeg sudo apt-get install ffmpeg
:
Create directory to store images
mkdir <image_folder_name>
Generate images from video at 5hz
ffmpeg -i <video file> -r 5 <image_folder_name>/<image_folder_name>%05d.jpg