Label file format

1,732 views
Skip to first unread message

Christer Lindqvist

unread,
Jun 21, 2016, 4:37:08 PM6/21/16
to DIGITS Users
Im wondering if anyone could explain how to make the label txt files. (im creating a object detection dataset). Ive put the image files (.png) and label files (.txt) in separate folders. But i just cant figure out how to create the label files. Im thinking maybe imagepath, label, description should be included?

Regards

Christer

John Maddison

unread,
Jun 23, 2016, 6:44:24 AM6/23/16
to DIGITS Users
Hi,

The closest I have managed on how to create them is the matlab scrip that is in the devkit here. http://www.cvlibs.net/datasets/kitti/eval_object.php

%  % extract label, truncation, occlusion
%   lbl = C{1}(o);                   % for converting: cell -> string
%   objects(o).type       = lbl{1};  % 'Car', 'Pedestrian', ...
%   objects(o).truncation = C{2}(o); % truncated pixel ratio ([0..1])
%   objects(o).occlusion  = C{3}(o); % 0 = visible, 1 = partly occluded, 2 = fully occluded, 3 = unknown
%   objects(o).alpha      = C{4}(o); % object observation angle ([-pi..pi])
%   % extract 2D bounding box in 0-based coordinates
%   objects(o).x1 = C{5}(o); % left
%   objects(o).y1 = C{6}(o); % top
%   objects(o).x2 = C{7}(o); % right
%   objects(o).y2 = C{8}(o); % bottom
%   % extract 3D bounding box information
%   objects(o).h    = C{9} (o); % box width
%   objects(o).w    = C{10}(o); % box height
%   objects(o).l    = C{11}(o); % box length
%   objects(o).t(1) = C{12}(o); % location (x)
%   objects(o).t(2) = C{13}(o); % location (y)
%   objects(o).t(3) = C{14}(o); % location (z)
%   objects(o).ry   = C{15}(o); % yaw angle

But this included info related to the 3D element of the object that I don't know what to do with. If you work this out I would be grateful to hear what you find.

John

Christer Lindqvist

unread,
Jun 23, 2016, 2:11:11 PM6/23/16
to DIGITS Users
Thanks John for replying.

I wonder if  ./tools/parse_folder.py <image root folder path>./<folder path>/labels.txt -t ./<folder path>/train.txt might work? as Lukeyeager wrote in the Digits Error (code 11) #223 thread.

I cant verify that myself though as i keep getting "not enough images for this category".

I got 50+ pictures in both img1 and img2 folders.
I checked the folder and file permissions. Everybody can view and modify.

"
2016-06-23 17:10:17 [DEBUG] Category - img1
2016-06-23 17:10:17 [WARNING] Not enough images for this category
2016-06-23 17:10:17 [DEBUG] Progress: 0.50
2016-06-23 17:10:17 [DEBUG] Category - img2
2016-06-23 17:10:17 [WARNING] Not enough images for this category
2016-06-23 17:10:17 [DEBUG] Progress: 1.00
2016-06-23 17:10:17 [ERROR] Did not find two valid categories
"
Any ideas?

Abhinav Kumar Gupta

unread,
Jun 24, 2016, 1:27:58 AM6/24/16
to DIGITS Users
We are not sure what is the right format for DIGIT training Label file for new Object Detection example.

From KITTI dataset we figured out the following.

2 folders of images and labels for each of Training and Validation. And label files to contain text files (with same name as images) with data in follwing format:

"
Car 0.88 3 -0.69 0.00 192.37 402.31 374.00 1.60 1.57 3.23 -2.70 1.74 3.68 -1.29
Car 0.00 1 2.04 334.85 178.94 624.50 372.04 1.57 1.50 3.68 -1.17 1.65 7.86 1.90
Car 0.34 3 -1.84 937.29 197.39 1241.00 374.00 1.39 1.44 3.08 3.81 1.64 6.15 -1.31
Car 0.00 1 -1.33 597.59 176.18 720.90 261.14 1.47 1.60 3.66 1.07 1.55 14.44 -1.25
Car 0.00 0 1.74 741.18 168.83 792.25 208.43 1.70 1.63 4.08 7.24 1.55 33.20 1.95
Car 0.00 0 -1.65 884.52 178.31 956.41 240.18 1.59 1.59 2.47 8.48 1.75 19.96 -1.25
DontCare -1 -1 -10 800.38 163.67 825.45 184.07 -1 -1 -1 -1000 -1000 -1000 -10
DontCare -1 -1 -10 859.58 172.34 886.26 194.51 -1 -1 -1 -1000 -1000 -1000 -10
DontCare -1 -1 -10 801.81 163.96 825.20 183.59 -1 -1 -1 -1000 -1000 -1000 -10
DontCare -1 -1 -10 826.87 162.28 845.84 178.86 -1 -1 -1 -1000 -1000 -1000 -10

"

This is not working. So can someone please help us out on what we are doing wrong ?

Abhinav


Thanks
Abhinav

--
You received this message because you are subscribed to the Google Groups "DIGITS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to digits-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/digits-users/de50e4ca-25a5-4e66-8112-3496a5d74b84%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Greg Heinrich

unread,
Jun 28, 2016, 4:45:02 AM6/28/16
to DIGITS Users
Hello, sorry for the slow feedback. The label format is described in the readme.txt file from the Object Development Kit archive (devkit_object.zip) which you may download from the KITTI website (Object Detection Evaluation 2012).
Note that those fields are ignored by DetectNet: alpha, scenario, roty, occlusion, dimensions, location.

Also note that the receptive fields in DetectNet work best if your bounding boxes are within 50px-300pixels in width.

@Christer: the error you got (2016-06-23 17:10:17 [WARNING] Not enough images for this category) suggests that you might have tried to create a classification dataset. To create an object detection dataset you need to click "New Dataset>Images>Object Detection" on the main page.

Christer Lindqvist

unread,
Jul 1, 2016, 5:21:06 PM7/1/16
to DIGITS Users
@greg Thank you for answering, much appreciated. Ill try the kitti dataset next.

I wonder if labeling can be done from within mathworks matlab? Maybe not in the kitti format. Just a thought.

Greg Heinrich

unread,
Jul 4, 2016, 7:20:57 AM7/4/16
to DIGITS Users
Hi Christer, sorry I am not sure I understand the question. Are you looking for a tool to help with image labelling?
Reply all
Reply to author
Forward
0 new messages