Rannotation is a tool to annotate images with rectangular bounding boxes of multiple categories.
pip install rannotation
- Prepare images in a directory.
- Create a labelmap in json format. Ex:
[
{
"id": 1,
"label": "Pedestrian"
},
{
"id": 2,
"label": "Car"
},
{
"id": 3,
"label": "Truck"
},
{
"id": 4,
"label": "Stopsign"
}
]
-
Prepare a csv file. If it's the first time usage, the tool will create a new csv file for you. If you want to resume from the previous work, prepare the csv output from then.
-
Start with
rannotate
command with 3 arguments:
rannotate \
--img_dir \
--csv_path \
--labelmap_path
-
Mouse:
-
Click on image : create new label OR deactivate labels
-
Click on a label : activate the label
-
Drag a label : move the label
-
Drag a marker : resize the label
-
Double click on a label : delete the label
-
-
Keys:
-
Enter : Save
-
Tab : Activate a label / switch active labels
-
Delete or d : Delete active label
-
h : Move an active label a few steps left
-
j : Move an active label a few steps down
-
k : Move an active label a few steps up
-
l : Move an active label a few steps left
-
b : Go to the previous image OR activate the previous label
-
n : Go to the next image OR activate the next label
-
s : Show/hide labels
-
q : Quit app
-
1-9 : Label category on the active label
-
i : Predict labels using the prediction model
-
- Clone this repo
- Install rannotation
- Use
./sample/annotation_tool_sample_sample.csv
,./sample/labelmap.json
, and./*.jpg
for sample data
-
csv should contain the following fields:
['filename', 'obj_name', 'xmin', 'ymin', 'xmax', 'ymax']
If there's no csv file in the path then a new csv file will be created. -
Currently the tool only supports up to 10 categories.