# Download the example dataset: BSDS300
wget https://www.eecs.berkeley.edu/Research/Projects/CS/vision/bsds/BSDS300-images.tgz
# Extract the images and create image list
tar xvf BSDS300-images.tgz
find BSDS300/ | grep jpg > image.lst
Specify the labels
and lst_path
. You may also want to adjust the image_rows
and image_cols
.
python qtlabel.py
After start the program, you will see the following UI. There are 3 parts in the UI: top/middle/bottom.
In this example, the label list contains: animal
, flower
and human
, which are specified in label.cfg
After choosing a label from the list, you can start labeling.
TIPS: Press F1~F12 to select the first ~ twelfth label.
The are 3 different background colors for each image:
- Green: this image is unlabelled
- Blue: this image is a positive sample for the selected label
- Red: this image is a negative sample for the selected label
Operations related to Image Browser:
- Click an image to open image viewer, which allows you view the large images.
- Click the image viewer to close it.
- Right click an image to change its label. Everytime you right click an image, the label will be written to the database.
The are three buttons at the bottom:
Pos & Next(Q)
(HotKey:Q
): mark all the Green images to Blue, then move to the next page.Neg & Next(W)
(HotKey:W
): mark all the Green images to Red, then move to the next page.Prev(E)
(HotKey:E
): move to the previous page.Next(R)
(HotKey:R
): move to the next page.
The label information will be stored in a sqlite3 database, which can be accessed via standard sqlite3 browser, e.g.
You may also get the labels from command line like this:
sqlite3 label.sqlite "select * from labels"
The above command will print a table of labels. The following command prints the schema of the table:
sqlite3 label.sqlite ".schema labels"
Positive samples will be marked as 1
, negative samples will be marked as -1
, unlabelled samples will be marked as 0
.