element in the file (change
17 | REPLACE_WITH_YOUR_LOCATION with the directory location of the LabelMe
18 | annotation tool code, e.g. /var/www/LabelMeAnnotationTool):
19 |
20 | ``` sh
21 |
22 | Options Indexes FollowSymLinks MultiViews +Includes
23 | AllowOverride all
24 | Order allow,deny
25 | allow from all
26 | AddType text/html .shtml
27 | AddOutputFilter INCLUDES .shtml
28 | DirectoryIndex index.shtml
29 |
30 | ```
31 |
32 | For Ubuntu 14.04 with Apache 2.4 (edit file /etc/apache2/sites-available/000-default.conf):
33 |
34 | ``` sh
35 |
36 | Options Indexes FollowSymLinks MultiViews Includes ExecCGI
37 | AddHandler cgi-script .cgi
38 | AllowOverride all
39 | Require all granted
40 | AddType text/html .shtml
41 | AddOutputFilter INCLUDES .shtml
42 | DirectoryIndex index.shtml
43 |
44 | ```
45 |
--------------------------------------------------------------------------------
/UBUNTU_16_04.md:
--------------------------------------------------------------------------------
1 | # UBUNTU 16.04 CONFIGURATION
2 |
3 | 1. Update and upgrade the Ubuntu distribution.
4 |
5 | ``` sh
6 | sudo apt-get update -y
7 |
8 | sudo DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade
9 | ```
10 |
11 | 1. Install a dependencies for LabelMe. This includes "Apache", "Perl", and git.
12 |
13 | ``` sh
14 | sudo apt-get install -y \
15 | apache2 \
16 | git \
17 | libapache2-mod-perl2 \
18 | libcgi-session-perl \
19 | libapache2-mod-php \
20 | make \
21 | php
22 | ```
23 |
24 | 1. Configure Apache.
25 |
26 | ``` sh
27 | sudo a2enmod include
28 |
29 | sudo a2enmod rewrite
30 |
31 | sudo a2enmod cgi
32 | ```
33 |
34 | 1. Edit `/etc/apache2/sites-available/000-default.conf` so that the following is
35 | the only element in the file.
36 |
37 | ``` sh
38 | sudo tee /etc/apache2/sites-available/000-default.conf <
40 | Options Indexes FollowSymLinks MultiViews Includes ExecCGI
41 | AddHandler cgi-script .cgi
42 | AllowOverride All
43 | Require all granted
44 | AddType text/html .shtml
45 | AddOutputFilter INCLUDES .shtml
46 | DirectoryIndex index.shtml
47 |
48 | EOL
49 | ```
50 |
51 | 1. Clone LabelMe from GitHub. Move the LabelMe files to Apache/web-server directories.
52 |
53 | ``` sh
54 | git clone https://github.com/CSAILVision/LabelMeAnnotationTool.git
55 |
56 | sudo mv ./LabelMeAnnotationTool/ /var/www/html/LabelMeAnnotationTool/
57 | ```
58 |
59 | 1. Run the *Makefile*.
60 |
61 | ```
62 | cd /var/www/html/LabelMeAnnotationTool/
63 |
64 | make
65 | ```
66 |
67 | 1. Update the permissions of the LabelMe files.
68 |
69 | ```
70 | sudo chown -R www-data:www-data /var/www/html
71 | ```
72 |
73 | 1. Restart Apache.
74 |
75 | ```
76 | sudo service apache2 restart
77 | ```
78 |
79 | *Note, there is a [YouTube tutorial](https://www.youtube.com/watch?v=07uHcjRjAbM) by thelittlekid that demos LabelMe installation on a local Ubuntu 16.04 box.*
80 |
--------------------------------------------------------------------------------
/WINDOWS.md:
--------------------------------------------------------------------------------
1 | ### WINDOWS CONFIGURATION:
2 |
3 | 1. Install "Apache" for windows.
4 |
5 | 2. Install "Active Perl".
6 |
7 | 3. Install "Cygwin". Make sure Cygwin is added to PATH (for "cp" in Windows).
8 |
9 | 4. Install "ImageMagick" (this is required for the "identify" command).
10 |
11 | 5. Make sure that all of the above (except LabelMe) works OK first.
12 |
13 | 6. Change the config file of Apache (httpd.conf) by adding the
14 | following:
15 |
16 | ``` sh
17 | # Added in line 194
18 | Options FollowSymLinks SymLinksIfOwnerMatch Indexes +Includes +ExecCGI
19 | AllowOverride AuthConfig
20 | AllowOverride All
21 | Order allow,deny
22 | Allow from all
23 |
24 | # Added in line 325
25 | Alias /LabelMe/ "C:/POSTDOC/LabelMe/"
26 |
27 | # Added and changed (line 338)
28 | #ScriptAlias /cgi-bin/ "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/"
29 | ScriptAlias /cgi-bin/ "C:/POSTDOC/LabelMe/"
30 |
31 | # Changed line 406
32 | AddHandler cgi-script .cgi .pl
33 |
34 | # Added and changed in line 417
35 | AddType text/html .shtml
36 | AddHandler server-parsed .shtml
37 | AddOutputFilter INCLUDES .shtml
38 | ```
39 |
40 | 7. Add the module "mod_rewrite" to the Active Perl version.
41 |
42 | 8. Change all the "#! /usr/bin/.." by "#!c:/Perl/bin/perl.exe" in all
43 | the scripts under LabelMe.
44 |
45 | 9. Add/change the scipt "fetch_image.cgi". See below all the file
46 | after the changes:
47 |
48 | ``` sh
49 | #!c:/Perl/bin/perl.exe
50 | # Get STDIN:
51 |
52 | read(STDIN,$collection,$ENV{'CONTENT_LENGTH'});
53 |
54 | $fname = "DirLists/$collection.txt";
55 |
56 | # Add this code:
57 | if(!open(xFP,$fname)) {
58 | print "Status: 404\n\n";
59 | return;
60 | }
61 | $numlines = 0;
62 | @lines = readline(xFP);
63 | foreach $i (@lines) {
64 | $numlines = $numlines + 1;
65 | };
66 | close(xFP);
67 | # end addition
68 |
69 | if(!open(FP,$fname)) {
70 | print "Status: 404\n\n";
71 | return;
72 | }
73 |
74 | # Remove the following:
75 | #open(NUMLINES,"wc -l $fname |");
76 | #$numlines = ;
77 | #($numlines,$bar) = split(" DirLists",$numlines);
78 | #close(NUMLINES);
79 | # Finished remove
80 |
81 | $line = int(rand($numlines))+1;
82 |
83 | for($i=1; $i $im_dir$im_file";
84 |
--------------------------------------------------------------------------------
/annotationCache/DirLists/labelme.txt:
--------------------------------------------------------------------------------
1 | example_folder,img1.jpg
2 | example_folder,img2.jpg
3 | example_folder,img3.jpg
4 |
--------------------------------------------------------------------------------
/annotationCache/TmpAnnotations/example_folder/img1.xml:
--------------------------------------------------------------------------------
1 | img1.jpg example_folder The MIT-CSAIL database of objects and scenes LabelMe Webtool window 0 0 25-May-2012 00:09:48 0 admin 1078 858 1123 854 1126 937 1078 940 1920 2560 license plate 0 0 no 27-Jul-2014 02:58:50 1 brussell 1457 1671.75 1559 1706.75 img1_mask_1.png 1456 1670.75 1570 1708.25 img1_scribble_1.png
--------------------------------------------------------------------------------
/annotationCache/XMLTemplates/labelme.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | myfile
4 |
5 |
6 | mydir
7 |
8 |
9 |
10 | The MIT-CSAIL database of objects and scenes
11 |
12 |
13 | LabelMe Webtool
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/annotationCache/counter:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationCache/counter
--------------------------------------------------------------------------------
/annotationCache/counter_tmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationCache/counter_tmp
--------------------------------------------------------------------------------
/annotationTools/css/bubble.css:
--------------------------------------------------------------------------------
1 |
2 |
3 | /* THE SPEECH BUBBLE ----------------------------------------------- */
4 |
5 | .bubble {
6 | position:relative;
7 | top:100px;
8 | left:20px;
9 | padding:15px;
10 | margin:1em 0 3em;
11 | background-color: #fff;
12 | border: 4px solid #f00;
13 | -webkit-border-radius:20px;
14 | -moz-border-radius:20px;
15 | border-radius:20px;
16 | -webkit-box-shadow: 2px 2px 4px #888;
17 | -moz-box-shadow: 2px 2px 4px #888;
18 | box-shadow: 2px 2px 4px #888;
19 |
20 | line-height:24px;
21 | font-family:'Cabin', Helvetica, Arial, sans-serif;
22 | font-size: 0.9em;
23 | line-height:1.4em;
24 | font-weight:400;
25 | }
26 |
27 | /* Variant : for top positioned triangle */
28 | .bubble.top {
29 | background-color: #fff;
30 | border: 4px solid #f00;
31 | }
32 |
33 | /* Variant : for left/right positioned triangle */
34 | .bubble.left {
35 | margin-left:50px;
36 | background:#fff;
37 | }
38 |
39 | /* Variant : for right positioned triangle */
40 | .bubble.right {
41 | margin-right:50px;
42 | background:#fff;
43 | }
44 |
45 | /* THE TRIANGLE
46 | ----------------------------------------------------------------------------------- */
47 |
48 | /* creates triangle */
49 |
50 | .bubble:after {
51 | content:"";
52 | position:absolute;
53 | bottom:-20px; /* value = - border-top-width - border-bottom-width */
54 | left:5px; /* controls horizontal position */
55 | right:auto;
56 | border-width:20px 15px 0; /* vary these values to change the angle of the vertex */
57 | border-style:solid;
58 | border-color:#f00 transparent;
59 | /* reduce the damage in FF3.0 */
60 | display:block;
61 | width:0;
62 | }
63 |
64 |
65 | /* Variant : top */
66 | .bubble.top:after {
67 | top:-20px; /* value = - border-top-width - border-bottom-width */
68 | left:5px; /* controls horizontal position */
69 | bottom:auto;
70 | right:auto;
71 | border-width:0 15px 20px; /* vary these values to change the angle of the vertex */
72 | border-color:#f00 transparent;
73 | }
74 |
75 | /* Variant : left */
76 | .bubbles.left:after {
77 | top:16px; /* controls vertical position */
78 | left:-20px; /* value = - border-left-width - border-right-width */
79 | bottom:auto;
80 | border-width:10px 20px 10px 0;
81 | border-color:transparent #f00;
82 | }
83 |
84 | /* Variant : right */
85 | .bubble.right:after {
86 | top:16px; /* controls vertical position */
87 | right:-20px; /* value = - border-left-width - border-right-width */
88 | bottom:auto;
89 | left:auto;
90 | border-width:10px 0 10px 20px;
91 | border-color:transparent #f00;
92 | }
93 |
94 |
95 |
96 |
--------------------------------------------------------------------------------
/annotationTools/css/header.css:
--------------------------------------------------------------------------------
1 |
2 |
3 | /********** HEADER *************/
4 |
5 | .header {
6 | background: #ED1C24;
7 | width:100%;
8 | min-width:640px;
9 | height:50px;
10 | padding-top:5px;
11 | }
12 |
13 | #logo{
14 | width:220px;
15 | /*display:table-cell;*/
16 | float:left;
17 | margin-right:0px;
18 | padding-left:20px;
19 | }
20 |
21 |
22 | #username_main_div{
23 | position:absolute;
24 | width:auto;
25 | right:20px;
26 | bottom:5px;
27 | /*height:50px;*/
28 | padding:0px;
29 | vertical-align: middle;
30 |
31 | line-height:24px;
32 | font-family:'Cabin', Helvetica, Arial, sans-serif;
33 | font-size: 0.9em;
34 | line-height:1.4em;
35 | font-weight:400;
36 | color: #fff;
37 | z-index:1;
38 | }
39 |
40 | .image_canvas {
41 | position:absolute;
42 | top:70px;
43 | left:55px;
44 | height:1em;
45 | /*width:250px;*/
46 | z-index:1;
47 | }
48 |
49 | /********** NAVIGATION BUTTONS *************/
50 |
51 | #label_buttons_navigation{
52 | position:absolute;
53 | top:8px;
54 | background-color:#fff;
55 | border: 2px solid #000;
56 | padding:2px;
57 | padding-left:10px;
58 | padding-right:10px;
59 | -webkit-border-radius:20px;
60 | -moz-border-radius:20px;
61 | border-radius:20px;
62 | /*height:52px;*/
63 | left:270px;
64 | margin-bottom:0px;
65 | display:block;
66 | }
67 | #label_buttons_contrast{
68 | position:absolute;
69 | top:8px;
70 | background-color:#fff;
71 | border: 2px solid #000;
72 | padding:2px;
73 | padding-left:10px;
74 | padding-right:10px;
75 | -webkit-border-radius:20px;
76 | -moz-border-radius:20px;
77 | border-radius:20px;
78 | /*height:52px;*/
79 | left:515px;
80 | margin-bottom:0px;
81 | display:block;
82 | }
83 |
84 | .labelBtn, img.labelBtn {
85 | background-color:#fff;
86 | border:none;
87 | margin-right:0px;
88 | margin-top:0px;
89 | cursor:pointer;
90 | /*-moz-border-radius:3px;
91 | -webkit-border-radius:3px;
92 | border-radius:3px;
93 |
94 | -webkit-box-shadow: 2px 2px 4px #888;
95 | -moz-box-shadow: 2px 2px 4px #888;
96 | box-shadow: 2px 2px 4px #888;
97 | text-decoration:none;*/
98 | }
99 |
100 | .labelBtn:hover, img.labelBtn:hover {
101 | background-color:#faa;
102 | /*-moz-box-shadow: 2px 2px 2px 0px #222;
103 | -webkit-box-shadow: 2px 2px 2px 0px #222;
104 | box-shadow: 2px 2px 2px 0px #222;*/
105 | cursor:pointer;
106 | text-decoration:none;
107 | }
108 |
109 | .labelBtn[disabled], .labelBtn[disabled]:hover{
110 | background-color:#666666;
111 | cursor:default;
112 | /*-moz-box-shadow: 2px 2px 3px 0px #111;
113 | -webkit-box-shadow: 2px 2px 3px 0px #111;
114 | box-shadow: 2px 2px 3px 0px #111;*/
115 | text-decoration:none;
116 | }
117 |
118 |
119 | #prevBtn.labelBtn{
120 | margin-left:25px;
121 | }
122 |
123 |
124 |
125 | /********** DRAWING BUTTONS *************/
126 |
127 | #label_buttons_drawing{
128 | position:absolute;
129 | top:70px;
130 | width:50px;
131 | height:55px;
132 | left:2px;
133 | margin-bottom:5px;
134 | /*display:block;*/
135 | }
136 |
137 | .labelBtnDraw, img.labelBtnDraw {
138 | background-color:#fff;
139 | border:none;
140 | margin-right:0px;
141 | margin-left:0px;
142 | margin-top:3px;
143 | cursor:pointer;
144 | /*-moz-border-radius:3px;
145 | -webkit-border-radius:3px;
146 | border-radius:3px;
147 |
148 | -webkit-box-shadow: 2px 2px 4px #888;
149 | -moz-box-shadow: 2px 2px 4px #888;
150 | box-shadow: 2px 2px 4px #888;
151 | text-decoration:none;*/
152 | }
153 |
154 | .labelBtnDraw:hover, img.labelBtnDraw:hover {
155 | background-color:#faa;
156 | /*-moz-box-shadow: 2px 2px 2px 0px #222;
157 | -webkit-box-shadow: 2px 2px 2px 0px #222;
158 | box-shadow: 2px 2px 2px 0px #222;*/
159 | cursor:pointer;
160 | text-decoration:none;
161 | }
162 |
163 | .labelBtnDraw[disabled], .labelBtnDraw[disabled]:hover{
164 | background-color:#666666;
165 | cursor:default;
166 | /*-moz-box-shadow: 2px 2px 3px 0px #111;
167 | -webkit-box-shadow: 2px 2px 3px 0px #111;
168 | box-shadow: 2px 2px 3px 0px #111;*/
169 | text-decoration:none;
170 | }
171 |
172 |
173 | #prevBtn.labelBtnDraw{
174 | margin-top:10px;
175 | }
176 |
177 |
178 |
179 |
180 |
181 |
--------------------------------------------------------------------------------
/annotationTools/css/object_list.css:
--------------------------------------------------------------------------------
1 |
2 |
3 | /* THE OBJECT LIST ----------------------------------------------- */
4 | #anno_anchor {
5 | position:absolute;
6 | top:0px;
7 | right:0px;
8 | height:100%;
9 | min-width:150px;
10 | }
11 |
12 | .object_list {
13 | position:absolute;
14 | top:70px;
15 | right:5px;
16 | min-width:180px;
17 | height:auto;
18 | /*bottom:5px;
19 | max-height:50%;*/
20 |
21 | max-height: -moz-calc(98% - 85px);
22 | max-height: -webkit-calc(98% - 85px);
23 | max-height: calc(98% - 85px);
24 |
25 | padding:5px;
26 | margin:0em 0 0em;
27 | background-color: #fff;
28 | border: 0px solid #000;
29 | -webkit-border-radius:20px;
30 | -moz-border-radius:20px;
31 | border-radius:5px 5px 5px 5px;
32 | /* -webkit-box-shadow: 2px 2px 4px #888;
33 | -moz-box-shadow: 2px 2px 4px #888;
34 | box-shadow: 2px 2px 4px #888; */
35 |
36 | font-family:'Cabin', Helvetica, Arial, sans-serif;
37 | font-size: 0.9em;
38 | line-height:1.4em;
39 | font-weight:400;
40 |
41 | overflow-y:auto;
42 | }
43 |
44 | .objectListLink {
45 | -moz-user-select:none;
46 | -khtml-user-drag: element;
47 | cursor: move;
48 | }
49 |
50 | .objectListLink:-webkit-drag {
51 | background-color:rgb(50,255,50)
52 | }
53 |
54 | /* format for the list */
55 | .object_list ol {
56 | list-style-type:square;
57 | margin-left:10px;
58 | margin-top:2px;
59 | margin-bottom:5px;
60 | margin-right:10px;
61 | padding-left:10px;
62 | }
63 |
64 | .children_tree {
65 | list-style-type:circle;
66 | list-style-image:url(../../Icons/arrow_tree.png);
67 | font-size: 0.8em;
68 | line-height:1.2em;
69 | }
70 |
71 |
72 |
--------------------------------------------------------------------------------
/annotationTools/css/scribblemenu.css:
--------------------------------------------------------------------------------
1 |
2 |
3 | /* THE SCRIBBLE MENU ----------------------------------------------- */
4 |
5 | .annotatemenu {
6 | position:relative;
7 | top:0px;
8 | background-color:#fff;
9 | border: 2px solid #000;
10 | padding:2px;
11 | padding-left:0px;
12 | padding-right:0px;
13 | padding-top:5px;
14 | padding-bottom:5px;
15 | -webkit-border-radius:10px;
16 | -moz-border-radius:10px;
17 | border-radius:10px;
18 | /*height:52px;*/
19 | left:1px;
20 | margin-bottom:10px;
21 | display:block;
22 | font-size: x-small;
23 | text-align: center;
24 |
25 |
26 |
27 | }
28 | #segmDiv {
29 | opacity: 1.;
30 |
31 | }
32 | #polygonDiv {
33 | opacity: 1.;
34 | }
35 | .segbut{
36 | -webkit-appearance: none;
37 | text-align: center;
38 | font-size: 8px;
39 | margin-top: 10px;
40 | width: 40px;
41 | height: 45px;
42 | background-color: rgb(245,245,245);
43 | }
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/annotationTools/css/styles.css:
--------------------------------------------------------------------------------
1 | body {font-family:Arial; color:black; overflow:hidden;
2 | margin-top:0px; margin-left:0px; margin-right:0px; margin-bottom: 0px;}
3 | a:link {color: #0000FF; text-decoration: underline;}
4 | a:visited {color: #0000FF; text-decoration: underline;}
5 | a:hover {color: #0000FF; text-decoration: underline;}
6 |
7 | table, div {border-collapse:collapse;}
8 | div#header {margin-top:0px; position:relative; width:100%;}
9 | #top_mid {margin-left:4em; font-size:small;}
10 | td {padding:0;}
11 | .top {vertical-align:top;}
12 | .center {text-align:center;}
13 | img {border:0; border-top:0;}
14 |
15 | #username_form {font-size:small;}
16 |
17 | #counter_anchor {position:absolute;
18 | top:8px; right:8px; width:16em;}
19 | #counter_text {font-size:small;}
20 |
21 | #show_new_image {position:absolute; right:0px; top:-2em;}
22 |
23 | #loading {position:absolute; font-size:large; left:1em;
24 | top:2em;}
25 | #main_media {position:absolute; left:0; top:0; border: 1px solid #979797;}
26 |
27 | #framebar{
28 | height:80px;
29 | position:relative;
30 | overflow-x:scroll;
31 | overflow-y:hidden;
32 | }
33 |
34 | #objectbar{
35 | position:relative;
36 |
37 | }
38 |
39 | .box {
40 | background-color: #eeeeee;
41 | border: 2px solid #dddddd;
42 | color: #000000;
43 | padding: 0px;
44 | position: absolute;
45 | }
46 |
47 | .bar {
48 | background-color: #aaaaff;
49 | border: 1px solid #8888ff;
50 | color: #000000;
51 | font-weight: normal;
52 | font-family: arial;
53 | position: relative;
54 | left:0px;top:0px;
55 | padding: 0px 0.2em 2px 0.2em;
56 | }
57 |
58 | .lowerbar {
59 | background-color: #aaaaff;
60 | border: 1px solid #8888ff;
61 | color: #000000;
62 | font-weight: normal;
63 | font-family: arial;
64 | padding: 0px 0.2em 6px 0.2em;
65 | }
66 |
67 | .close {
68 | background-color: #8888ff;
69 | border: 0px;
70 | color: #ffffff;
71 | font-weight: bold;
72 | font-family: arial;
73 | height:16px;
74 | width:14px;
75 | position: absolute;
76 | right:0px;top:0px;
77 | }
78 |
79 | .resize {
80 | background-color: #4444ff;
81 | border: 0px;
82 | color: #ffffff;
83 | font-weight: bold;
84 | font-family: arial;
85 | padding: 0px 0em 6px 5px;
86 | position: absolute;
87 | right:0px;bottom:0px;
88 | }
89 |
90 |
91 | .content {
92 | border: 1px solid #ffffff;
93 | padding: 0.2em;
94 | overflow: auto;
95 | }
96 |
97 | #right_side {position:absolute; top:0px; right:0px; width:20em;
98 | height:100%; z-index:0;}
99 | #examples {width:100%; font-size:small;}
100 | #anno_list {font-size:small;}
101 |
--------------------------------------------------------------------------------
/annotationTools/html/badbrowser.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Sorry! This page only works with Mozilla Firefox, Chrome, and Internet Explorer. We may
4 | support other browsers in the future.
5 |
6 | Download Mozilla Firefox?
7 |
8 |
--------------------------------------------------------------------------------
/annotationTools/html/why_signin.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | By signing in you can keep track of your annotations:
18 |
19 |
20 | If you download the dataset, you may wish to work with only those labels that
21 | you add. With the LabelMe
22 | Matlab toolbox , you may query annotations based on your submitted username.
23 |
Example: If you signed in with the username 'bob', then you can search the database
24 | using the command LMquery:
25 |
> Dbob = LMquery(D, 'object.polygon.username', 'bob');
26 |
This command will return the index structure Dbob which will only contain the
27 | polygons annotated by the user "bob".
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/annotationTools/js/api/browser.js.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | JSDoc: Source: browser.js
6 |
7 |
8 |
9 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
Source: browser.js
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | /** @file This file contains functions for detecting and interacting with the different browser types. */
30 |
31 | var bname;
32 | var bversion;
33 |
34 | function GetBrowserInfo() {
35 | // alert(navigator.appCodeName);
36 | // alert(navigator.appName);
37 | // alert(navigator.appVersion);
38 | // alert(navigator.cookieEnabled);
39 | // alert(navigator.platform);
40 | // alert(navigator.userAgent);
41 | WriteLogMsg('*Browser_Information ' + navigator.userAgent);
42 |
43 | bname = navigator.appName;
44 | if(IsMicrosoft()) {
45 | var arVersion = navigator.appVersion.split("MSIE");
46 | bversion = parseFloat(arVersion[1]);
47 | }
48 | else if(IsNetscape() || IsSafari()) {
49 | bversion = parseInt(navigator.appVersion);
50 | //check for Safari.
51 | if(navigator.userAgent.match('Safari')) bname = 'Safari';
52 | }
53 | else bversion = 0;
54 | }
55 |
56 | function IsNetscape() {
57 | return (bname.indexOf("Netscape")!=-1);
58 | }
59 |
60 | function IsMicrosoft() {
61 | return (bname.indexOf("Microsoft")!=-1);
62 | }
63 |
64 | function IsSafari() {
65 | return (bname.indexOf("Safari")!=-1);
66 | }
67 |
68 | function IsChrome() {
69 | return (bname.indexOf("chrome")!=-1);
70 | }
71 |
72 | function getCookie(c_name) {
73 | if (document.cookie.length>0) {
74 | c_start=document.cookie.indexOf(c_name + "=");
75 | if (c_start!=-1) {
76 | c_start=c_start + c_name.length+1;
77 | c_end=document.cookie.indexOf(";",c_start);
78 | if (c_end==-1) c_end=document.cookie.length;
79 | return unescape(document.cookie.substring(c_start,c_end));
80 | }
81 | }
82 | return null
83 | }
84 |
85 | function setCookie(c_name,value,expiredays) {
86 | var exdate=new Date();
87 | exdate.setDate(expiredays);
88 | document.cookie=c_name+ "=" +escape(value)+
89 | ((expiredays==null) ? "" : "; expires="+exdate);
90 | }
91 |
92 | /** This function gets a variable from the URL (or the COOKIES)
93 | * @example:
94 | * // returns the username
95 | * var username = getQueryVariable("username");
96 | */
97 | function getQueryVariable(variable) {
98 | var query = window.location.search.substring(1);
99 | var vars = query.split("&");
100 | for (var i=0;i<vars.length;i++) {
101 | var pair = vars[i].split("=");
102 | if (pair[0] == variable) {
103 | return pair[1];
104 | }
105 | }
106 | return getCookie(variable);
107 | }
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 | Classes Global
119 |
120 |
121 |
122 |
123 |
124 | Documentation generated by JSDoc 3.4.0-dev on Thu Mar 12 2015 16:00:31 GMT-0700 (PDT)
125 |
126 |
127 |
128 |
129 |
130 |
131 |
--------------------------------------------------------------------------------
/annotationTools/js/api/fonts/OpenSans-Bold-webfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationTools/js/api/fonts/OpenSans-Bold-webfont.eot
--------------------------------------------------------------------------------
/annotationTools/js/api/fonts/OpenSans-Bold-webfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationTools/js/api/fonts/OpenSans-Bold-webfont.woff
--------------------------------------------------------------------------------
/annotationTools/js/api/fonts/OpenSans-BoldItalic-webfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationTools/js/api/fonts/OpenSans-BoldItalic-webfont.eot
--------------------------------------------------------------------------------
/annotationTools/js/api/fonts/OpenSans-BoldItalic-webfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationTools/js/api/fonts/OpenSans-BoldItalic-webfont.woff
--------------------------------------------------------------------------------
/annotationTools/js/api/fonts/OpenSans-Italic-webfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationTools/js/api/fonts/OpenSans-Italic-webfont.eot
--------------------------------------------------------------------------------
/annotationTools/js/api/fonts/OpenSans-Italic-webfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationTools/js/api/fonts/OpenSans-Italic-webfont.woff
--------------------------------------------------------------------------------
/annotationTools/js/api/fonts/OpenSans-Light-webfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationTools/js/api/fonts/OpenSans-Light-webfont.eot
--------------------------------------------------------------------------------
/annotationTools/js/api/fonts/OpenSans-Light-webfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationTools/js/api/fonts/OpenSans-Light-webfont.woff
--------------------------------------------------------------------------------
/annotationTools/js/api/fonts/OpenSans-LightItalic-webfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationTools/js/api/fonts/OpenSans-LightItalic-webfont.eot
--------------------------------------------------------------------------------
/annotationTools/js/api/fonts/OpenSans-LightItalic-webfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationTools/js/api/fonts/OpenSans-LightItalic-webfont.woff
--------------------------------------------------------------------------------
/annotationTools/js/api/fonts/OpenSans-Regular-webfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationTools/js/api/fonts/OpenSans-Regular-webfont.eot
--------------------------------------------------------------------------------
/annotationTools/js/api/fonts/OpenSans-Regular-webfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationTools/js/api/fonts/OpenSans-Regular-webfont.woff
--------------------------------------------------------------------------------
/annotationTools/js/api/globals.js.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | JSDoc: Source: globals.js
6 |
7 |
8 |
9 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
Source: globals.js
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | /** @file Contains the global variables used in LabelMe. */
30 |
31 | // Parsed LabelMe XML file. Manipulate this variable with jquery.
32 | var LM_xml;
33 |
34 | // URL of CGI script to submit XML annotation:
35 | var SubmitXmlUrl = 'annotationTools/perl/submit.cgi';
36 |
37 | // LabelMe username:
38 | var username = 'anonymous';
39 |
40 | // Boolean indicating whether user is currently signing in (this should be abstracted into class):
41 | var username_flag = 0;
42 |
43 | // Boolean indicating if we will use attributes. This should be read from the URL and set to 0 by default.
44 | var use_attributes = 1; // if this is 0, then it will remove all the attributes from the bubble.
45 | var use_parts = 1; // if this is 0 disapears the message from the bubble
46 |
47 | // for now, let's remove the attributes in MT mode. Just in case anybody is trying this.
48 | if (getQueryVariable('mode')=='mt'){
49 | use_attributes=0;
50 | use_parts = 0;
51 | }
52 |
53 | // Boolean indicating whether the control points were edited:
54 | var editedControlPoints = 0;
55 |
56 | // Scalar indicating which polygon is selected; -1 means no polygon is selected
57 | var selected_poly = -1;
58 |
59 | // Array storing all of the annotation structures. Eventually this will be
60 | // removed since we should read directly from LM_xml.
61 | var AllAnnotations = Array(0);
62 |
63 | // Class with functions to handle actions/events.
64 | var main_handler;
65 |
66 | // Canvas that renders polygons at rest state.
67 | var main_canvas;
68 |
69 | // Holds image.
70 | var main_media;
71 |
72 | // URL of XHTML namespace. This is needed for generating SVG elements.
73 | var xhtmlNS = 'http://www.w3.org/1999/xhtml';
74 |
75 | // Website that refers to LabelMe:
76 | var ref;
77 |
78 | // Scribble mode:
79 | var scribble_mode = true;
80 |
81 | var video_mode = false;
82 |
83 | var wait_for_input;
84 | var edit_popup_open = 0;
85 | var num_orig_anno;
86 | var global_count = 0;
87 | var req_submit;
88 |
89 | // Indicates if polygon has been edited.
90 | var submission_edited = 0;
91 |
92 | // Allowable user actions:
93 | var action_CreatePolygon = 1;
94 | var action_RenameExistingObjects = 0;
95 | var action_ModifyControlExistingObjects = 0;
96 | var action_DeleteExistingObjects = 0;
97 |
98 | // Which polygons are visible:
99 | var view_Existing = 1;
100 | var view_Deleted = 0;
101 |
102 | // Flag for right-hand object list:
103 | var view_ObjList = true;
104 |
105 | // Mechanical Turk variables:
106 | var LMbaseurl = 'http://' + window.location.host + window.location.pathname;
107 | var MThelpPage = 'annotationTools/html/mt_instructions.html';
108 | var externalSubmitURL = 'http://mturk.com/mturk/externalSubmit';
109 | var externalSubmitURLsandbox = 'http://workersandbox.mturk.com/mturk/externalSubmit';
110 | var mt_N = 'inf';
111 |
112 | var object_choices = '...';
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 | Classes Global
125 |
126 |
127 |
128 |
129 |
130 | Documentation generated by JSDoc 3.4.0-dev on Thu Mar 12 2015 16:00:31 GMT-0700 (PDT)
131 |
132 |
133 |
134 |
135 |
136 |
137 |
--------------------------------------------------------------------------------
/annotationTools/js/api/io.js.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | JSDoc: Source: io.js
6 |
7 |
8 |
9 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
Source: io.js
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | /** @file Input/output functions for writing annotation files to the LabelMe server. */
30 |
31 | function ReadXML(xml_file,SuccessFunction,ErrorFunction) {
32 | $.ajax({
33 | type: "GET",
34 | url: xml_file,
35 | dataType: "xml",
36 | success: SuccessFunction,
37 | error: ErrorFunction
38 | });
39 | }
40 |
41 | function WriteXML(url,xml_data,SuccessFunction,ErrorFunction) {
42 | oXmlSerializer = new XMLSerializer();
43 | sXmlString = oXmlSerializer.serializeToString(xml_data);
44 |
45 | // use regular expressions to replace all occurrences of
46 | sXmlString = sXmlString.replace(/ xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"/g, "");
47 |
48 |
49 | $.ajax({
50 | type: "POST",
51 | url: url,
52 | data: sXmlString,
53 | contentType: "text/xml",
54 | dataType: "text",
55 | success: SuccessFunction,
56 | error: function(xhr,ajaxOptions,thrownError) {
57 | console.log(xhr.status);
58 | console.log(thrownError);
59 | }
60 | });
61 | }
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 | Classes Global
73 |
74 |
75 |
76 |
77 |
78 | Documentation generated by JSDoc 3.4.0-dev on Thu Mar 12 2015 16:00:31 GMT-0700 (PDT)
79 |
80 |
81 |
82 |
83 |
84 |
85 |
--------------------------------------------------------------------------------
/annotationTools/js/api/scripts/linenumber.js:
--------------------------------------------------------------------------------
1 | /*global document */
2 | (function() {
3 | var source = document.getElementsByClassName('prettyprint source linenums');
4 | var i = 0;
5 | var lineNumber = 0;
6 | var lineId;
7 | var lines;
8 | var totalLines;
9 | var anchorHash;
10 |
11 | if (source && source[0]) {
12 | anchorHash = document.location.hash.substring(1);
13 | lines = source[0].getElementsByTagName('li');
14 | totalLines = lines.length;
15 |
16 | for (; i < totalLines; i++) {
17 | lineNumber++;
18 | lineId = 'line' + lineNumber;
19 | lines[i].id = lineId;
20 | if (lineId === anchorHash) {
21 | lines[i].className += ' selected';
22 | }
23 | }
24 | }
25 | })();
26 |
--------------------------------------------------------------------------------
/annotationTools/js/api/scripts/prettify/lang-css.js:
--------------------------------------------------------------------------------
1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n"]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]*)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["com",
2 | /^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]);
3 |
--------------------------------------------------------------------------------
/annotationTools/js/api/sign_in.js.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | JSDoc: Source: sign_in.js
6 |
7 |
8 |
9 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
Source: sign_in.js
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | /** @file Sign in form for a user to enter their LabelMe username. */
30 |
31 | // This code is very complex for what it is doing.
32 | // Needs optimization
33 | //
34 | // PlaceSignInHTML() is complex. Needs to make more explicit all the elements.
35 |
36 |
37 | function initUserName() {
38 | // The first time we get the username will give preference to the username passed
39 | // in the URL as it might come from the LabelMe browser.
40 | username = getQueryVariable("username");
41 |
42 | if (!username || (username.length==0)) {
43 | username = getCookie("username");
44 | if (!username || (username.length==0)) {
45 | username = "anonymous";
46 | }
47 | }
48 |
49 | if (username=="null") {username = "anonymous";}
50 |
51 | setCookie("username",username);
52 | $("#usernametxt").text(username);
53 | }
54 |
55 | function show_enterUserNameDIV() {
56 | // This function simply swaps the divs to show the "changeAndDisplayUserName" div
57 | $("#display_user").hide();
58 | $("#enterUserName").show();
59 | // put the cursor inside the text box
60 | document.getElementById('userEnter').focus();
61 | document.getElementById('userEnter').select();
62 |
63 | return false;
64 | }
65 |
66 | function changeAndDisplayUserName(c) {
67 | // Shows the entered name.
68 | // c is the key that produced getting out of the text box.
69 | // only change the username is the user pressed "enter" -> c==13
70 | if (c==13){
71 | username = $("#userEnter").val();
72 |
73 | if (username.length==0) {
74 | username = getCookie("username");
75 | }
76 |
77 | setCookie("username",username);
78 | $("#usernametxt").text(username);
79 | }
80 |
81 | $("#display_user").show();
82 | $("#enterUserName").hide();
83 | }
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 | Classes Global
95 |
96 |
97 |
98 |
99 |
100 | Documentation generated by JSDoc 3.4.0-dev on Thu Mar 12 2015 16:00:31 GMT-0700 (PDT)
101 |
102 |
103 |
104 |
105 |
106 |
107 |
--------------------------------------------------------------------------------
/annotationTools/js/api/styles/prettify-jsdoc.css:
--------------------------------------------------------------------------------
1 | /* JSDoc prettify.js theme */
2 |
3 | /* plain text */
4 | .pln {
5 | color: #000000;
6 | font-weight: normal;
7 | font-style: normal;
8 | }
9 |
10 | /* string content */
11 | .str {
12 | color: #006400;
13 | font-weight: normal;
14 | font-style: normal;
15 | }
16 |
17 | /* a keyword */
18 | .kwd {
19 | color: #000000;
20 | font-weight: bold;
21 | font-style: normal;
22 | }
23 |
24 | /* a comment */
25 | .com {
26 | font-weight: normal;
27 | font-style: italic;
28 | }
29 |
30 | /* a type name */
31 | .typ {
32 | color: #000000;
33 | font-weight: normal;
34 | font-style: normal;
35 | }
36 |
37 | /* a literal value */
38 | .lit {
39 | color: #006400;
40 | font-weight: normal;
41 | font-style: normal;
42 | }
43 |
44 | /* punctuation */
45 | .pun {
46 | color: #000000;
47 | font-weight: bold;
48 | font-style: normal;
49 | }
50 |
51 | /* lisp open bracket */
52 | .opn {
53 | color: #000000;
54 | font-weight: bold;
55 | font-style: normal;
56 | }
57 |
58 | /* lisp close bracket */
59 | .clo {
60 | color: #000000;
61 | font-weight: bold;
62 | font-style: normal;
63 | }
64 |
65 | /* a markup tag name */
66 | .tag {
67 | color: #006400;
68 | font-weight: normal;
69 | font-style: normal;
70 | }
71 |
72 | /* a markup attribute name */
73 | .atn {
74 | color: #006400;
75 | font-weight: normal;
76 | font-style: normal;
77 | }
78 |
79 | /* a markup attribute value */
80 | .atv {
81 | color: #006400;
82 | font-weight: normal;
83 | font-style: normal;
84 | }
85 |
86 | /* a declaration */
87 | .dec {
88 | color: #000000;
89 | font-weight: bold;
90 | font-style: normal;
91 | }
92 |
93 | /* a variable name */
94 | .var {
95 | color: #000000;
96 | font-weight: normal;
97 | font-style: normal;
98 | }
99 |
100 | /* a function name */
101 | .fun {
102 | color: #000000;
103 | font-weight: bold;
104 | font-style: normal;
105 | }
106 |
107 | /* Specify class=linenums on a pre to get line numbering */
108 | ol.linenums {
109 | margin-top: 0;
110 | margin-bottom: 0;
111 | }
112 |
--------------------------------------------------------------------------------
/annotationTools/js/api/styles/prettify-tomorrow.css:
--------------------------------------------------------------------------------
1 | /* Tomorrow Theme */
2 | /* Original theme - https://github.com/chriskempson/tomorrow-theme */
3 | /* Pretty printing styles. Used with prettify.js. */
4 | /* SPAN elements with the classes below are added by prettyprint. */
5 | /* plain text */
6 | .pln {
7 | color: #4d4d4c; }
8 |
9 | @media screen {
10 | /* string content */
11 | .str {
12 | color: #718c00; }
13 |
14 | /* a keyword */
15 | .kwd {
16 | color: #8959a8; }
17 |
18 | /* a comment */
19 | .com {
20 | color: #8e908c; }
21 |
22 | /* a type name */
23 | .typ {
24 | color: #4271ae; }
25 |
26 | /* a literal value */
27 | .lit {
28 | color: #f5871f; }
29 |
30 | /* punctuation */
31 | .pun {
32 | color: #4d4d4c; }
33 |
34 | /* lisp open bracket */
35 | .opn {
36 | color: #4d4d4c; }
37 |
38 | /* lisp close bracket */
39 | .clo {
40 | color: #4d4d4c; }
41 |
42 | /* a markup tag name */
43 | .tag {
44 | color: #c82829; }
45 |
46 | /* a markup attribute name */
47 | .atn {
48 | color: #f5871f; }
49 |
50 | /* a markup attribute value */
51 | .atv {
52 | color: #3e999f; }
53 |
54 | /* a declaration */
55 | .dec {
56 | color: #f5871f; }
57 |
58 | /* a variable name */
59 | .var {
60 | color: #c82829; }
61 |
62 | /* a function name */
63 | .fun {
64 | color: #4271ae; } }
65 | /* Use higher contrast and text-weight for printable form. */
66 | @media print, projection {
67 | .str {
68 | color: #060; }
69 |
70 | .kwd {
71 | color: #006;
72 | font-weight: bold; }
73 |
74 | .com {
75 | color: #600;
76 | font-style: italic; }
77 |
78 | .typ {
79 | color: #404;
80 | font-weight: bold; }
81 |
82 | .lit {
83 | color: #044; }
84 |
85 | .pun, .opn, .clo {
86 | color: #440; }
87 |
88 | .tag {
89 | color: #006;
90 | font-weight: bold; }
91 |
92 | .atn {
93 | color: #404; }
94 |
95 | .atv {
96 | color: #060; } }
97 | /* Style */
98 | /*
99 | pre.prettyprint {
100 | background: white;
101 | font-family: Consolas, Monaco, 'Andale Mono', monospace;
102 | font-size: 12px;
103 | line-height: 1.5;
104 | border: 1px solid #ccc;
105 | padding: 10px; }
106 | */
107 |
108 | /* Specify class=linenums on a pre to get line numbering */
109 | ol.linenums {
110 | margin-top: 0;
111 | margin-bottom: 0; }
112 |
113 | /* IE indents via margin-left */
114 | li.L0,
115 | li.L1,
116 | li.L2,
117 | li.L3,
118 | li.L4,
119 | li.L5,
120 | li.L6,
121 | li.L7,
122 | li.L8,
123 | li.L9 {
124 | /* */ }
125 |
126 | /* Alternate shading for lines */
127 | li.L1,
128 | li.L3,
129 | li.L5,
130 | li.L7,
131 | li.L9 {
132 | /* */ }
133 |
--------------------------------------------------------------------------------
/annotationTools/js/api/xml_accessors.js.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | JSDoc: Source: xml_accessors.js
6 |
7 |
8 |
9 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
Source: xml_accessors.js
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | /** @file This file contains functions for reading attributes of an xml.
30 | */
31 |
32 | /** Gets a field for an object from an xml. If frame value is provided, it gives the field at the given.
33 | * @param {string} xml - The xml containing the annotations
34 | * @param {int} ind_object - Index to the object to be displayed
35 | * @param {string} name - name of the field to return.
36 | * @param {int} frame - frame of interest
37 | */
38 | function LMgetObjectField(xml,ind_object, name, frame) {
39 | var obj = $(xml).children("annotation").children("object").eq(ind_object);
40 | if (obj.length == 0) return "";
41 | if (name == 'name' || name == 'deleted' || name == 'attributes' || name == 'occluded'){
42 | if (!obj.children(name)) return "";
43 | return obj.children(name).text();
44 | }
45 | if (name == 'x' || name == 'y'){
46 | if (frame){
47 | var framestamps = (obj.children("polygon").children("t").text()).split(',')
48 | for(var ti=0; ti<framestamps.length; ti++) { framestamps[ti] = parseInt(framestamps[ti], 10); }
49 | var objectind = framestamps.indexOf(frame);
50 | if (objectind == -1) return null;
51 | var coords = ((obj.children("polygon").children(name).text()).split(';')[objectind]).split(',');
52 | for(var ti=0; ti<coords.length; ti++) { coords[ti] = parseInt(coords[ti], 10); }
53 | return coords;
54 |
55 | }
56 | else {
57 | var pt_elts = obj.children("polygon")[0].getElementsByTagName("pt");
58 | if (pt_elts){
59 | var coord = Array(pt_elts.length);
60 | for (var ii=0; ii < coord.length; ii++){
61 |
62 | coord[ii] = parseInt(pt_elts[ii].getElementsByTagName(name)[0].firstChild.nodeValue);
63 | }
64 | return coord;
65 | }
66 | }
67 | }
68 | return "";
69 |
70 |
71 | }
72 |
73 | /** Returns number of LabelMe objects. */
74 | function LMnumberOfObjects(xml) {
75 | return xml.getElementsByTagName('object').length;
76 | }
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 | Classes Global
90 |
91 |
92 |
93 |
94 |
95 | Documentation generated by JSDoc 3.4.0-dev on Thu Mar 12 2015 16:00:31 GMT-0700 (PDT)
96 |
97 |
98 |
99 |
100 |
101 |
102 |
--------------------------------------------------------------------------------
/annotationTools/js/browser.js:
--------------------------------------------------------------------------------
1 | /** @file This file contains functions for detecting and interacting with the different browser types. */
2 |
3 | var bname;
4 | var bversion;
5 |
6 | function GetBrowserInfo() {
7 | // alert(navigator.appCodeName);
8 | // alert(navigator.appName);
9 | // alert(navigator.appVersion);
10 | // alert(navigator.cookieEnabled);
11 | // alert(navigator.platform);
12 | // alert(navigator.userAgent);
13 | WriteLogMsg('*Browser_Information ' + navigator.userAgent);
14 |
15 | bname = navigator.appName;
16 | if(IsMicrosoft()) {
17 | var arVersion = navigator.appVersion.split("MSIE");
18 | bversion = parseFloat(arVersion[1]);
19 | }
20 | else if(IsNetscape() || IsSafari()) {
21 | bversion = parseInt(navigator.appVersion);
22 | //check for Safari.
23 | if(navigator.userAgent.match('Safari')) bname = 'Safari';
24 | }
25 | else bversion = 0;
26 | }
27 |
28 | function IsNetscape() {
29 | return (bname.indexOf("Netscape")!=-1);
30 | }
31 |
32 | function IsMicrosoft() {
33 | return (bname.indexOf("Microsoft")!=-1);
34 | }
35 |
36 | function IsSafari() {
37 | return (bname.indexOf("Safari")!=-1);
38 | }
39 |
40 | function IsChrome() {
41 | return (bname.indexOf("chrome")!=-1);
42 | }
43 |
44 | function getCookie(c_name) {
45 | if (document.cookie.length>0) {
46 | c_start=document.cookie.indexOf(c_name + "=");
47 | if (c_start!=-1) {
48 | c_start=c_start + c_name.length+1;
49 | c_end=document.cookie.indexOf(";",c_start);
50 | if (c_end==-1) c_end=document.cookie.length;
51 | return unescape(document.cookie.substring(c_start,c_end));
52 | }
53 | }
54 | return null
55 | }
56 |
57 | function setCookie(c_name,value,expiredays) {
58 | var exdate=new Date();
59 | exdate.setDate(expiredays);
60 | document.cookie=c_name+ "=" +escape(value)+
61 | ((expiredays==null) ? "" : "; expires="+exdate);
62 | }
63 |
64 | /** This function gets a variable from the URL (or the COOKIES)
65 | * @example:
66 | * // returns the username
67 | * var username = getQueryVariable("username");
68 | */
69 | function getQueryVariable(variable) {
70 | var query = window.location.search.substring(1);
71 | var vars = query.split("&");
72 | for (var i=0;i c==13
42 | if (c==13){
43 | username = $("#userEnter").val();
44 |
45 | if (username.length==0) {
46 | username = getCookie("username");
47 | }
48 |
49 | setCookie("username",username);
50 | $("#usernametxt").text(username);
51 | }
52 |
53 | $("#display_user").show();
54 | $("#enterUserName").hide();
55 | }
56 |
--------------------------------------------------------------------------------
/annotationTools/js/tests.js:
--------------------------------------------------------------------------------
1 | QUnit.test( "hello test", function( assert ) {
2 | assert.ok( 1 == "1", "Passed!" );
3 | });
4 |
5 | QUnit.test( "ReadXML test", function( assert ) {
6 | var done = assert.async();
7 | var anno_file = "Annotations/example_folder/img1.xml"
8 | var SuccessFunction = function(xml) {
9 | assert.ok(true,"Successfully loaded XML file");
10 | LM_xml = xml;
11 | SetAllAnnotationsArray();
12 | var pts_x = Array(1078, 1123, 1126, 1078);
13 | var pts_y = Array(858, 854, 937, 940);
14 | var passed_test = true;
15 | for(var i = 0; i < pts_x.length; i++) {
16 | if(AllAnnotations[0].pts_x[i] != pts_x[i]) {
17 | passed_test = false;
18 | }
19 | if(AllAnnotations[0].pts_y[i] != pts_y[i]) {
20 | passed_test = false;
21 | }
22 | }
23 | assert.ok( passed_test, "Passed polygon coordinate test." );
24 | done();
25 | };
26 | var FailureFunction = function() {
27 | assert.ok( false, "Failed to load XML file" );
28 | };
29 | ReadXML(anno_file,SuccessFunction,FailureFunction);
30 | });
31 |
32 | QUnit.test( "LMgetObjectField test", function( assert ) {
33 | var done = assert.async();
34 | var anno_file = "Annotations/example_folder/img1.xml"
35 | var SuccessFunction = function(xml) {
36 | assert.ok(true,"Successfully loaded XML file");
37 | LM_xml = xml;
38 | var passed_test = true;
39 | console.log(LMgetObjectField(LM_xml, 0, 'username'));
40 | if ('admin' !=LMgetObjectField(LM_xml, 0, 'username')) passed_test = false;
41 | assert.ok( passed_test, "Passed username test." );
42 | test_x = LMgetObjectField(LM_xml, 0, 'x');
43 | test_y = LMgetObjectField(LM_xml, 0, 'y');
44 | var pts_x = Array(1078, 1123, 1126, 1078);
45 | var pts_y = Array(858, 854, 937, 940);
46 |
47 | for(var i = 0; i < pts_x.length; i++) {
48 | if(test_x[i] != pts_x[i]) {
49 | passed_test = false;
50 | }
51 | if(test_y[i] != pts_y[i]) {
52 | passed_test = false;
53 | }
54 | }
55 | assert.ok( passed_test, "Passed coordinate getting test." );
56 | done();
57 | };
58 | var FailureFunction = function() {
59 | assert.ok( false, "Failed to load XML file" );
60 | };
61 | ReadXML(anno_file,SuccessFunction,FailureFunction);
62 | });
--------------------------------------------------------------------------------
/annotationTools/perl/fetch_image.cgi:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl
2 |
3 | use strict;
4 | use CGI;
5 | use CGI::Carp qw ( fatalsToBrowser );
6 |
7 | require 'globalvariables.pl';
8 | use vars qw($LM_HOME);
9 |
10 | my $query = new CGI;
11 | my $mode = $query->param("mode");
12 | my $username = $query->param("username");
13 | my $collection = $query->param("collection");
14 | my $folder = $query->param("folder");
15 | my $image = $query->param("image");
16 |
17 | my $im_dir;
18 | my $im_file;
19 | if($mode eq "mt") {
20 | my $fname = $LM_HOME . "annotationCache/DirLists/$collection.txt";
21 |
22 | if(!open(FP,$fname)) {
23 | print "Status: 404\n\n";
24 | return;
25 | }
26 |
27 | open(NUMLINES,"wc -l $fname |");
28 | my $numlines = ;
29 | ($numlines,my $bar) = split(" DirLists",$numlines);
30 | close(NUMLINES);
31 |
32 | my $line = int(rand($numlines))+1;
33 |
34 | for(my $i=1; $i < $line; $i++) {
35 | my $garbage = readline(FP);
36 | }
37 |
38 | my $fileinfo = readline(FP);
39 | ($im_dir,$im_file) = split(",",$fileinfo);
40 | $im_file =~ tr/"\n"//d; # remove trailing newline
41 |
42 | close(FP);
43 | }
44 | if($mode eq "i") {
45 | my $fname = $LM_HOME . "annotationCache/DirLists/$collection.txt";
46 |
47 | if(!open(FP,$fname)) {
48 | print "Status: 404\n\n";
49 | return;
50 | }
51 |
52 | open(NUMLINES,"wc -l $fname |");
53 | my $numlines = ;
54 | ($numlines,my $bar) = split(" DirLists",$numlines);
55 | close(NUMLINES);
56 |
57 | my $line = int(rand($numlines))+1;
58 |
59 | for(my $i=1; $i < $line; $i++) {
60 | my $garbage = readline(FP);
61 | }
62 |
63 | my $fileinfo = readline(FP);
64 | ($im_dir,$im_file) = split(",",$fileinfo);
65 | $im_file =~ tr/"\n"//d; # remove trailing newline
66 |
67 | close(FP);
68 | }
69 | elsif($mode eq "c") {
70 | my $fname = $LM_HOME . "annotationCache/DirLists/$collection.txt";
71 |
72 | if(!open(FP,$fname)) {
73 | print "Status: 404\n\n";
74 | return;
75 | }
76 |
77 | open(NUMLINES,"wc -l $fname |");
78 | my $numlines = ;
79 | ($numlines,my $bar) = split(" DirLists",$numlines);
80 | close(NUMLINES);
81 |
82 | my @all_images=(); # initialise empty array
83 | my @all_folders=(); # initialise empty
84 | for(my $i = 0; $i < int($numlines); $i++) {
85 | my $fileinfo = readline(FP);
86 | (my $temp_dir,my $temp_file) = split(",",$fileinfo);
87 | $temp_file =~ tr/"\n"//d; # remove trailing newline
88 | $all_images[$i]=$temp_file; #append images
89 | $all_folders[$i]=$temp_dir;
90 | }
91 | close(FP);
92 |
93 | my $c = 0;
94 | foreach my $i (@all_images) {
95 | if($i eq $image) {
96 | goto next_section;
97 | }
98 | $c = $c+1;
99 | }
100 | next_section:
101 | if($c == scalar(@all_images)-1) {
102 | $c = -1;
103 | }
104 | $im_file = $all_images[$c+1];
105 | $im_dir = $all_folders[$c+1];
106 | }
107 | elsif($mode eq "f") {
108 | opendir(DIR,$LM_HOME . "Images/$folder") || die("Cannot read folder $LM_HOME/Images/$folder");
109 | my @all_images = readdir(DIR);
110 | closedir(DIR);
111 |
112 | my $do_rand = 1;
113 | my $i = 0;
114 | if($image =~ m/\.jpg$/) {
115 | $do_rand = 0;
116 |
117 | # Get location of image in array:
118 | for(my $j = 0; $j < scalar(@all_images); $j++) {
119 | if($all_images[$j] =~ m/^$image$/) {
120 | $i = $j;
121 | last;
122 | }
123 | }
124 | }
125 |
126 | do {
127 | if($do_rand) {
128 | $i = int(rand(scalar(@all_images)));
129 | }
130 | else {
131 | $i = ($i + 1) % scalar(@all_images);
132 | }
133 | $im_dir = $folder;
134 | $im_file = $all_images[$i];
135 | }
136 | while(!($im_file =~ m/\.jpg$/))
137 |
138 | # my $fname = "DirLists/$collection.txt";
139 | #
140 | # if(!open(FP,$fname)) {
141 | # print "Status: 404\n\n";
142 | # return;
143 | # }
144 | #
145 | # open(NUMLINES,"wc -l $fname |");
146 | # my $numlines = ;
147 | # ($numlines,my $bar) = split(" DirLists",$numlines);
148 | # close(NUMLINES);
149 | #
150 | # my $line = int(rand($numlines))+1;
151 | #
152 | # for(my $i=1; $i < $line; $i++) {
153 | # my $garbage = readline(FP);
154 | # }
155 | #
156 | # my $fileinfo = readline(FP);
157 | # ($im_dir,$im_file) = split(",",$fileinfo);
158 | # $im_file =~ tr/"\n"//d; # remove trailing newline
159 | #
160 | # close(FP);
161 | }
162 |
163 | # Send back data:
164 | print "Content-type: text/xml\n\n" ;
165 | print "$im_dir $im_file ";
166 |
--------------------------------------------------------------------------------
/annotationTools/perl/fetch_prev_image.cgi:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl
2 |
3 | use strict;
4 | use CGI;
5 | use CGI::Carp qw ( fatalsToBrowser );
6 |
7 | require 'globalvariables.pl';
8 | use vars qw($LM_HOME);
9 |
10 | my $query = new CGI;
11 | my $mode = $query->param("mode");
12 | my $username = $query->param("username");
13 | my $collection = $query->param("collection");
14 | my $folder = $query->param("folder");
15 | my $image = $query->param("image");
16 |
17 | my $im_dir;
18 | my $im_file;
19 | if($mode eq "mt") {
20 | my $fname = $LM_HOME . "annotationCache/DirLists/$collection.txt";
21 |
22 | if(!open(FP,$fname)) {
23 | print "Status: 404\n\n";
24 | return;
25 | }
26 |
27 | open(NUMLINES,"wc -l $fname |");
28 | my $numlines = ;
29 | ($numlines,my $bar) = split(" DirLists",$numlines);
30 | close(NUMLINES);
31 |
32 | my $line = int(rand($numlines))+1;
33 |
34 | for(my $i=1; $i < $line; $i++) {
35 | my $garbage = readline(FP);
36 | }
37 |
38 | my $fileinfo = readline(FP);
39 | ($im_dir,$im_file) = split(",",$fileinfo);
40 | $im_file =~ tr/"\n"//d; # remove trailing newline
41 |
42 | close(FP);
43 | }
44 | if($mode eq "i") {
45 | my $fname = $LM_HOME . "annotationCache/DirLists/$collection.txt";
46 |
47 | if(!open(FP,$fname)) {
48 | print "Status: 404\n\n";
49 | return;
50 | }
51 |
52 | open(NUMLINES,"wc -l $fname |");
53 | my $numlines = ;
54 | ($numlines,my $bar) = split(" DirLists",$numlines);
55 | close(NUMLINES);
56 |
57 | my $line = int(rand($numlines))+1;
58 |
59 | for(my $i=1; $i < $line; $i++) {
60 | my $garbage = readline(FP);
61 | }
62 |
63 | my $fileinfo = readline(FP);
64 | ($im_dir,$im_file) = split(",",$fileinfo);
65 | $im_file =~ tr/"\n"//d; # remove trailing newline
66 |
67 | close(FP);
68 | }
69 | elsif($mode eq "c") {
70 | my $fname = $LM_HOME . "annotationCache/DirLists/$collection.txt";
71 |
72 | if(!open(FP,$fname)) {
73 | print "Status: 404\n\n";
74 | return;
75 | }
76 |
77 | open(NUMLINES,"wc -l $fname |");
78 | my $numlines = ;
79 | ($numlines,my $bar) = split(" DirLists",$numlines);
80 | close(NUMLINES);
81 |
82 | my @all_images=(); # initialise empty array
83 | my @all_folders=(); # initialise empty
84 | for(my $i = 0; $i < int($numlines); $i++) {
85 | my $fileinfo = readline(FP);
86 | (my $temp_dir,my $temp_file) = split(",",$fileinfo);
87 | $temp_file =~ tr/"\n"//d; # remove trailing newline
88 | $all_images[$i]=$temp_file; #append images
89 | $all_folders[$i]=$temp_dir;
90 | }
91 | close(FP);
92 |
93 | my $c = 0;
94 | foreach my $i (@all_images) {
95 | if($i eq $image) {
96 | goto next_section;
97 | }
98 | $c = $c+1;
99 | }
100 | next_section:
101 | if($c == 0){
102 | $c = scalar(@all_images)
103 | }
104 | $im_file = $all_images[$c-1];
105 | $im_dir = $all_folders[$c-1];
106 | }
107 | elsif($mode eq "f") {
108 | opendir(DIR,$LM_HOME . "Images/$folder") || die("Cannot read folder $LM_HOME/Images/$folder");
109 | my @all_images = readdir(DIR);
110 | closedir(DIR);
111 |
112 | my $do_rand = 1;
113 | my $i = 0;
114 | if($image =~ m/\.jpg$/) {
115 | $do_rand = 0;
116 |
117 | # Get location of image in array:
118 | for(my $j = 0; $j < scalar(@all_images); $j++) {
119 | if($all_images[$j] =~ m/$image/) {
120 | $i = $j;
121 | last;
122 | }
123 | }
124 | }
125 |
126 | do {
127 | if($do_rand) {
128 | $i = int(rand(scalar(@all_images)));
129 | }
130 | else {
131 | $i = ($i - 1) % scalar(@all_images);
132 | }
133 | $im_dir = $folder;
134 | $im_file = $all_images[$i];
135 | }
136 | while(!($im_file =~ m/\.jpg$/))
137 | }
138 |
139 | # Send back data:
140 | print "Content-type: text/xml\n\n" ;
141 | print "$im_dir $im_file ";
142 |
--------------------------------------------------------------------------------
/annotationTools/perl/get_timestamp.cgi:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl
2 | require 'globalvariables.pl';
3 | require 'logfile_helper.pl';
4 |
5 | # Get the timestamp:
6 | $datestr = &GetTimeStamp;
7 |
8 | print "Content-type: text/html\n\n";
9 | print "$datestr";
10 |
--------------------------------------------------------------------------------
/annotationTools/perl/globalvariables.pl.base:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl
2 |
3 | $LM_HOME = "LM_TOOL_HOME";
4 |
--------------------------------------------------------------------------------
/annotationTools/perl/logfile_helper.pl:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl
2 | require 'globalvariables.pl';
3 |
4 | sub WriteLogfile {
5 | my($datestr2,$folder,$fname,$tot_before,$tot_after,$addr,$host,$objname,$global_count,$username,$modifiedControlPoints,$tot_del_before,$tot_del_after) = @_;
6 | open(FP,">>$LM_HOME/annotationCache/Logs/logfile.txt");
7 | print FP "\n$datestr2 $folder $fname $tot_before $tot_after $addr $host $objname $global_count $username $modifiedControlPoints $tot_del_before $tot_del_after"; #include $ref???
8 | close(FP);
9 | }
10 |
11 | sub GetPrivateData {
12 | my($stdin) = @_;
13 |
14 | # Get the global count:
15 | ($global_count,$junk) = split("",$stdin);
16 | ($junk,$global_count) = split("",$global_count);
17 |
18 | # Get the username:
19 | ($username,$junk) = split("",$stdin);
20 | ($junk,$username) = split("",$username);
21 |
22 | # Get the edited flag:
23 | ($edited,$junk) = split("",$stdin);
24 | ($junk,$edited) = split("",$edited);
25 |
26 | # Get the old_name flag:
27 | ($old_name,$junk) = split("",$stdin);
28 | ($junk,$old_name) = split("",$old_name);
29 |
30 | # Get the new_name flag:
31 | ($new_name,$junk) = split("",$stdin);
32 | ($junk,$new_name) = split("",$new_name);
33 |
34 | # Get the modifiedControlPoints flag:
35 | ($modifiedControlPoints,$junk) = split("",$stdin);
36 | ($junk,$modifiedControlPoints) = split("",$modifiedControlPoints);
37 |
38 | # Get the video flag
39 | ($video_mode,$junk) = split("",$stdin);
40 | ($junk,$video_mode) = split("",$video_mode);
41 |
42 |
43 | # Check if names are empty:
44 | if($old_name eq "") {
45 | $old_name = "*empty*";
46 | }
47 | if($new_name eq "") {
48 | $new_name = "*empty*";
49 | }
50 |
51 | return ($global_count,$username,$edited,$old_name,$new_name,$modifiedControlPoints, $video_mode);
52 | }
53 |
54 | sub GetTimeStamp {
55 | ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time);
56 | $monword = (qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec))[$mon];
57 | $mon = sprintf("%2.2d",$mon+1);
58 | $mday = sprintf("%2.2d",$mday);
59 | $year = $year+1900;
60 | $hour = sprintf("%2.2d",$hour);
61 | $min = sprintf("%2.2d",$min);
62 | $sec = sprintf("%2.2d",$sec);
63 |
64 | $datestr = join ':', $mon,$mday,$year,$hour,$min,$sec;
65 |
66 | $datefirst = join '-', $mday,$monword,$year;
67 | $datesecond = join ':', $hour,$min,$sec;
68 | $datestr2 = join ' ', $datefirst,$datesecond;
69 | return $datestr2;
70 | }
71 |
72 | sub IsSubmittedXmlOk {
73 | my($stdin) = @_;
74 |
75 | # Check to make sure $stdin ends with :
76 | $isOK = ($stdin =~ m/<\/annotation>$/);
77 |
78 | return ($isOK);
79 | }
80 |
81 | sub InsertImageSize {
82 | my($stdin,$folder,$fname) = @_;
83 |
84 | $_ = $stdin;
85 | if(m/<\s*imagesize\s*>/) {
86 | # Separate out stuff :
87 | @ss = split('<\s*imagesize\s*>',$stdin);
88 | $anno1 = $ss[0];
89 | @ss = split('<\s*/\s*imagesize\s*>',$ss[1]);
90 | $anno2 = $ss[1];
91 | $imagesize = $ss[0]; # Contains "stuff"
92 |
93 | # Remove leading and trailing whitespace:
94 | $imagesize =~ s/^\s*//g;
95 | $imagesize =~ s/\s*$//g;
96 |
97 | $isrow = 0;
98 | $iscol = 0;
99 | $_ = $imagesize;
100 | $imagesize = "";
101 | while(m/<\s*(\w*)[ \/]*>/) {
102 | # Extract tag and tagname:
103 | $tagname = $1;
104 |
105 | # Find end of field and separate from string:
106 | if(m/(.*?(<\s*\/\s*$tagname\s*>|<\s*$tagname\s*\/\s*>))(.*)/) {
107 | $field = $1;
108 | $_ = $3;
109 | }
110 |
111 | if($tagname =~ m/nrows/) {
112 | $isrow = 1;
113 | if($field =~ m/\s*<\s*nrows\s*>\s*[0-9]+\s*<\s*\/\s*nrows\s*>\s*/) {
114 | $imagesize = "$imagesize$field";
115 | }
116 | else {
117 | $nrows = `identify -format \"%h\" $LM_HOME/Images/$folder/$fname.jpg`;
118 | $nrows =~ s/\s//g;
119 | $imagesize = "$imagesize$nrows ";
120 | }
121 | }
122 | elsif($tagname =~ m/ncols/) {
123 | $iscol = 1;
124 | if($field =~ m/\s*<\s*ncols\s*>\s*[0-9]+\s*<\s*\/\s*ncols\s*>\s*/) {
125 | $imagesize = "$imagesize$field";
126 | }
127 | else {
128 | $ncols = `identify -format \"%w\" $LM_HOME/Images/$folder/$fname.jpg`;
129 | $ncols =~ s/\s//g;
130 | $imagesize = "$imagesize$ncols ";
131 | }
132 | }
133 | else {
134 | $imagesize = "$imagesize$field";
135 | }
136 | }
137 |
138 | if(!$isrow) {
139 | $nrows = `identify -format \"%h\" $LM_HOME/Images/$folder/$fname.jpg`;
140 | $nrows =~ s/\s//g;
141 | $imagesize = "$imagesize$nrows ";
142 | }
143 | if(!$iscol) {
144 | $ncols = `identify -format \"%w\" $LM_HOME/Images/$folder/$fname.jpg`;
145 | $ncols =~ s/\s//g;
146 | $imagesize = "$imagesize$ncols ";
147 | }
148 |
149 | $stdin = "$anno1$imagesize $anno2";
150 | }
151 | elsif(m/<\s*imagesize\s*\/\s*>/) {
152 | # Replace
153 | $ncols = `identify -format \"%w\" $LM_HOME/Images/$folder/$fname.jpg`;
154 | $nrows = `identify -format \"%h\" $LM_HOME/Images/$folder/$fname.jpg`;
155 | $nrows =~ s/\s//g;
156 | $ncols =~ s/\s//g;
157 | $stdin =~ s/<\s*imagesize\s*\/\s*>/$nrows<\/nrows>$ncols<\/ncols><\/imagesize>/g;
158 | }
159 | else {
160 | # Missing: insert
161 | $ncols = `identify -format \"%w\" $LM_HOME/Images/$folder/$fname.jpg`;
162 | $nrows = `identify -format \"%h\" $LM_HOME/Images/$folder/$fname.jpg`;
163 | $nrows =~ s/\s//g;
164 | $ncols =~ s/\s//g;
165 | $stdin =~ s/<\s*\/\s*annotation\s*>/$nrows<\/nrows>$ncols<\/ncols><\/imagesize><\/annotation>/g;
166 | }
167 |
168 | return ($stdin);
169 | }
170 |
171 | 1;
172 |
--------------------------------------------------------------------------------
/annotationTools/perl/submit.cgi:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl
2 | require 'globalvariables.pl';
3 | require 'logfile_helper.pl';
4 |
5 | ##############################
6 | # Get the timestamp:
7 | $datestr2 = &GetTimeStamp;
8 |
9 | ##############################
10 | # Get host information and IP address:
11 | $addr = $ENV{'REMOTE_ADDR'};
12 | $host = $ENV{'REMOTE_HOST'};
13 |
14 | ##############################
15 | # Get STDIN:
16 | read(STDIN, $stdin, $ENV{'CONTENT_LENGTH'});
17 |
18 | ##############################
19 | # Remove newlines from annotation information:
20 | $stdin =~ s/\n//g;
21 |
22 | # Remove ^M from stdin:
23 | $stdin =~ tr/\t//d;
24 | $stdin =~ tr/\r//d;
25 |
26 |
27 | ##############################
28 | # Get file information:
29 | ($fname,$junk) = split("",$stdin);
30 | ($junk,$fname) = split("",$fname);
31 |
32 | if (index($fname, ".") != -1) {
33 | $fname = substr($fname,0,length($fname)-4);
34 | }
35 |
36 | # Remove all non alphanumer characters except for _, -
37 | $fname =~ tr/\-0-9A-Z_a-z//cd;
38 |
39 | ($folder,$junk) = split("",$stdin);
40 | ($junk,$folder) = split("",$folder);
41 |
42 | $folder =~ tr/\-0-9A-Z_a-z\///cd;
43 | ##############################
44 | # Get private data:
45 | ($global_count,$username,$edited,$old_name,$new_name,$modifiedControlPoints, $video_mode) = &GetPrivateData($stdin);
46 | ($left_side,$stdin) = split("",$stdin);
47 | ($junk,$stdin) = split(" ",$stdin);
48 | $stdin = "$left_side$stdin";
49 |
50 | ##############################
51 | # Determine if Video or Image and assign path:
52 | $path = $LM_HOME . "Annotations";
53 | $tmpPath = $LM_HOME . "annotationCache/TmpAnnotations";
54 | if ($video_mode){
55 | $path = $LM_HOME . "VLMAnnotations";
56 | }
57 |
58 | ##############################
59 | # Insert the time into the new polygons:
60 | $stdin =~ s/ /$datestr2<\/date>/g;
61 |
62 | ##############################
63 | # Check to make sure submitted XML is ok:
64 | if(!&IsSubmittedXmlOk($stdin)) {
65 | open(FP,">>$LM_HOME/annotationCache/Logs/logfile.txt");
66 | print FP "\n$datestr2 $folder $fname $addr *XML_ERROR $username";
67 | close(FP);
68 | print "Content-type: text/xml\n\n" ;
69 | print "There was a problem saving the submitted XML to the LabelMe server. Please try again. If this problem persists, please contact the Labelme developers." ;
70 | return;
71 | }
72 |
73 | ##############################
74 | # Get number of annotations BEFORE:
75 | open(FP,"$path/$folder/$fname.xml");
76 | @before_lines = readline(FP);
77 | $tot_before = 0;
78 | $tot_del_before = 0;
79 | foreach $i (@before_lines) {
80 | @poly_split = split("",$i);
81 | $tot_before = $tot_before + scalar(@poly_split)-1;
82 | @del_split = split("1 ",$i);
83 | $tot_del_before = $tot_del_before + scalar(@del_split)-1;
84 | }
85 | close(FP);
86 |
87 | ##############################
88 | # Get number of annotations AFTER:
89 | @poly_split = split("",$stdin);
90 | $tot_after = scalar(@poly_split)-1;
91 | @del_split = split("1 ",$stdin);
92 | $tot_del_after = scalar(@del_split)-1;
93 |
94 | ##############################
95 | # Add image dimension information if it does not exist:
96 | ($stdin) = &InsertImageSize($stdin,$folder,$fname);
97 |
98 | ##############################
99 | # Write to annotation XML file:
100 | @all_folders = split("/",$folder);
101 | $accum_path = "";
102 | foreach $i (@all_folders) {
103 | unless(-d "$tmpPath/$accum_path$i") {
104 | mkdir "$tmpPath/$accum_path$i" or die;
105 | }
106 | unless(-d "$path/$accum_path$i") {
107 | mkdir "$path/$accum_path$i" or die;
108 | }
109 | $accum_path = "$accum_path$i/";
110 | }
111 | open(FP,">$tmpPath/$folder/$fname.xml");
112 | print FP $stdin;
113 | close(FP);
114 |
115 | system("cp $tmpPath/$folder/$fname.xml $path/$folder/$fname.xml");
116 |
117 | ##############################
118 | # Get object name information:
119 | if($edited) {
120 | $objname = "$old_name->$new_name";
121 | }
122 | else {
123 | $objname = $old_name;
124 | }
125 | # Remove spaces from the name:
126 | $objname =~ s/\s/_/g;
127 |
128 | ##############################
129 | # Remove spaces from username
130 | $username =~ s/\s/_/g;
131 |
132 | ##############################
133 | # Write to logfile:
134 | &WriteLogfile($datestr2,$folder,$fname,$tot_before,$tot_after,$addr,$host,$objname,$global_count,$username,$modifiedControlPoints,$tot_del_before,$tot_del_after);
135 |
136 | print "Content-type: text/xml\n\n" ;
137 | print $stdin;
138 | print $fname;
139 |
140 |
--------------------------------------------------------------------------------
/annotationTools/perl/write_logfile.cgi:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl
2 | require 'globalvariables.pl';
3 | require 'logfile_helper.pl';
4 |
5 | ##############################
6 | # Get STDIN:
7 | read(STDIN, $stdin, $ENV{'CONTENT_LENGTH'});
8 | #$stdin = ;
9 |
10 | # Remove ^M from stdin:
11 | #$stdin =~ s/'\t'/''/g;
12 | $stdin =~ tr/\t//d;
13 | $stdin =~ tr/\r//d;
14 |
15 | ##############################
16 | # Get the timestamp:
17 | $datestr2 = &GetTimeStamp;
18 |
19 | ##############################
20 | # Get host information and IP address:
21 | $addr = $ENV{'REMOTE_ADDR'};
22 |
23 | ##############################
24 | # Write to logfile:
25 | open(FP,">>$LM_HOME/annotationCache/Logs/logfile.txt");
26 | print FP "\n$datestr2 $addr $stdin";
27 | close(FP);
28 |
29 | print "Content-type: text/xml\n\n" ;
30 | print " \n";
31 |
--------------------------------------------------------------------------------
/annotationTools/php/createdir.php:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/annotationTools/php/encode.php:
--------------------------------------------------------------------------------
1 |
2 | [ ]\r\n");
22 | }
23 |
24 | if ($inpath == "") $inpath = "./";
25 | $foldername = explode("/", $inpath)[count(explode("/", $inpath))-2];
26 | $version = 1.0;
27 | $dir = dir($inpath);
28 |
29 | $files = Array();
30 | $count = 1;
31 |
32 | $mode = 1;
33 | $format = "%010d";
34 | while ($file = $dir->read()) {
35 | if ($count == 1){
36 | $entry = $file;
37 | if (strpos($file,'_') !== false){
38 | $mode = 0;
39 | $scpos = strrpos($entry, "_");
40 | $entry = substr($entry, $scpos+1);
41 | }
42 | $length = strlen($entry)-4;
43 | $format = "%0".$length."d";
44 | }
45 | if (strtolower(substr($file, -4)) == ".jpg") {
46 | //if ($count >= $initframe and $count <=$last_frame) array_push($files, $inpath . "/" . $file);
47 | $count++;
48 | }
49 | }
50 | $count--;
51 | $last_frame = $initframe + $duration*$framerate;
52 | if ($last_frame >= $count) $last_frame = $count;
53 | $i = $initframe;
54 |
55 |
56 | while (intval($i) <= intval($last_frame)){
57 | if ($mode == 0) $file = $inpath ."/". $foldername . "_". sprintf($format, $i) . ".jpg";
58 | else $file = $inpath ."/". sprintf($format, $i) . ".jpg";
59 | //echo $inpath;
60 | array_push($files, $file);
61 | $i++;
62 |
63 | }
64 | $output = "{\r\n";
65 | $output .= "frm:\"JSVID\",\r\n";
66 | $output .= "ver:" . $version . ",\r\n";
67 | $output .= "width:" . $width . ",\r\n";
68 | $output .= "height:" . $height . ",\r\n";
69 | $output .= "rate:" . $framerate . ",\r\n";
70 | $output .= "firstframe:" . $initframe . ",\r\n";
71 | $output .= "frames:" . $count . ",\r\n";
72 | $output .= "data:{\r\n";
73 | $output .= "video:[\r\n";
74 | for ($i=0;$i
94 |
--------------------------------------------------------------------------------
/annotationTools/php/getpackfile.php:
--------------------------------------------------------------------------------
1 | open($zipname, ZipArchive::CREATE )!==TRUE) {
17 | exit("cannot open\n");
18 | }
19 |
20 | // Add the image and the xml
21 | $zip->addFile($imageurl, $imname);
22 | $zip->addFile($xmlurl, $xmlname);
23 | $zip->addEmptyDir("Masks");
24 | $zip->addEmptyDir("Scribbles");
25 |
26 | // Add the masks
27 | $maskurl = $TOOLHOME. "Masks/".$folder."/".substr($imname,0,-4)."_mask_";
28 | $scriburl = $TOOLHOME. "Scribbles/".$folder."/".substr($imname,0,-4)."_scribble_";
29 | /*$cont = 0;
30 | while (file_exists($maskurl.strval($cont).".png")){
31 | $zip->addFile($maskurl.strval($cont).".png", "Masks/".substr($imname,0,-4)."_".strval($cont).".png");
32 | $cont++;
33 | }
34 | $cont = 0;
35 | while (file_exists($scriburl.strval($cont).".png")){
36 | $zip->addFile($scriburl.strval($cont).".png", "Scribbles/".substr($imname,0,-4)."_".strval($cont).".png");
37 | $cont++;
38 | }*/
39 | foreach (glob($maskurl."*") as $file) {
40 | $cont = basename($file);
41 | $zip->addFile($file, "Masks/".$cont);//substr($imname,0,-4)."_".strval($cont).".png");
42 | }
43 | foreach (glob($scriburl."*") as $file) {
44 | $cont = basename($file);
45 | $zip->addFile($file, "Scribbles/".$cont);
46 | }
47 |
48 | $zip->close();
49 | // download
50 | $zipped_size = filesize($zipname);
51 |
52 | header("Content-Description: File Transfer");
53 | header("Content-type: application/zip");
54 | header("Content-Type: application/force-download");// some browsers need this
55 | header("Content-Disposition: attachment; filename=$zipname");
56 | header('Expires: 0');
57 | header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
58 | header('Pragma: public');
59 | header("Content-Length:". " $zipped_size");
60 | ob_clean();
61 | flush();
62 |
63 | readfile("$zipname");
64 | unlink("$zipname"); // Now delete the temp file (some servers need this option)*/
65 |
66 |
67 | exit;
68 |
69 | ?>
70 |
--------------------------------------------------------------------------------
/annotationTools/php/globalvariables.php.base:
--------------------------------------------------------------------------------
1 |
2 | ::Reset, ScanFirst() and ScanNext() did not work properly).
14 | - Implementation with a forward star representation of the graph is no longer supported. (It needs less memory, but slightly slower than adjacency list representation.) If you still wish to use it, download version 2.2.
15 | - Note: version 3.0 is released under a different license than version 2.2.
16 |
17 | List of changes from version 2.1:
18 |
19 | - Put the code under GPL license
20 |
21 | List of changes from version 2.02:
22 |
23 | - Fixed a bug in the implementation that uses forward star representation
24 |
25 | List of changes from version 2.01:
26 |
27 | - Added new interface function - Graph::add_tweights(Node_id, captype, captype)
28 | (necessary for the "ENERGY" software package)
29 |
30 |
--------------------------------------------------------------------------------
/annotationTools/scribble/segmentCPP/Makefile:
--------------------------------------------------------------------------------
1 | # all: test.cpp
2 | # emcc test.cpp -o test.js -s EXPORTED_FUNCTIONS="['_float_multiply_array']"
3 |
4 | example: example.cpp graph.cpp maxflow.cpp
5 | emcc example.cpp maxflow.cpp graph.cpp -o example.js -s EXPORTED_FUNCTIONS="['_grabCut']" -s TOTAL_MEMORY=60000000 -O2
6 |
--------------------------------------------------------------------------------
/annotationTools/scribble/segmentCPP/README.TXT:
--------------------------------------------------------------------------------
1 | ###################################################################
2 | # #
3 | # MAXFLOW - software for computing mincut/maxflow in a graph #
4 | # Version 3.01 #
5 | # http://www.cs.ucl.ac.uk/staff/V.Kolmogorov/software.html #
6 | # #
7 | # Yuri Boykov (yuri@csd.uwo.ca) #
8 | # Vladimir Kolmogorov (v.kolmogorov@cs.ucl.ac.uk) #
9 | # 2001-2006 #
10 | # #
11 | ###################################################################
12 |
13 | 1. Introduction.
14 |
15 | This software library implements the maxflow algorithm described in
16 |
17 | "An Experimental Comparison of Min-Cut/Max-Flow Algorithms for Energy Minimization in Vision."
18 | Yuri Boykov and Vladimir Kolmogorov.
19 | In IEEE Transactions on Pattern Analysis and Machine Intelligence (PAMI),
20 | September 2004
21 |
22 | This algorithm was developed by Yuri Boykov and Vladimir Kolmogorov
23 | at Siemens Corporate Research. To make it available for public use,
24 | it was later reimplemented by Vladimir Kolmogorov based on open publications.
25 |
26 | If you use this software for research purposes, you should cite
27 | the aforementioned paper in any resulting publication.
28 |
29 | ----------------------------------------------------------------------
30 |
31 | REUSING TREES:
32 |
33 | Starting with version 3.0, there is a also an option of reusing search
34 | trees from one maxflow computation to the next, as described in
35 |
36 | "Efficiently Solving Dynamic Markov Random Fields Using Graph Cuts."
37 | Pushmeet Kohli and Philip H.S. Torr
38 | International Conference on Computer Vision (ICCV), 2005
39 |
40 | If you use this option, you should cite
41 | the aforementioned paper in any resulting publication.
42 |
43 | Tested under windows, Visual C++ 6.0 compiler and unix (SunOS 5.8
44 | and RedHat Linux 7.0, GNU c++ compiler).
45 |
46 | ##################################################################
47 |
48 | 2. License & disclaimer.
49 |
50 | Copyright 2001-2006 Vladimir Kolmogorov (v.kolmogorov@cs.ucl.ac.uk), Yuri Boykov (yuri@csd.uwo.ca).
51 |
52 | This software can be used for research purposes only.
53 | If you require another license, you may consider using version 2.21
54 | (which implements exactly the same algorithm, but does not have the option of reusing search trees).
55 |
56 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
57 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
58 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
59 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
60 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
61 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
62 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
63 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
64 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
65 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
66 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
67 |
68 | ##################################################################
69 |
70 | 3. Example usage.
71 |
72 | This section shows how to use the library to compute
73 | a minimum cut on the following graph:
74 |
75 | SOURCE
76 | / \
77 | 1/ \2
78 | / 3 \
79 | node0 -----> node1
80 | | <----- |
81 | | 4 |
82 | \ /
83 | 5\ /6
84 | \ /
85 | SINK
86 |
87 | ///////////////////////////////////////////////////
88 |
89 | #include
90 | #include "graph.h"
91 |
92 | int main()
93 | {
94 | typedef Graph GraphType;
95 | GraphType *g = new GraphType(/*estimated # of nodes*/ 2, /*estimated # of edges*/ 1);
96 |
97 | g -> add_node();
98 | g -> add_node();
99 |
100 | g -> add_tweights( 0, /* capacities */ 1, 5 );
101 | g -> add_tweights( 1, /* capacities */ 2, 6 );
102 | g -> add_edge( 0, 1, /* capacities */ 3, 4 );
103 |
104 | int flow = g -> maxflow();
105 |
106 | printf("Flow = %d\n", flow);
107 | printf("Minimum cut:\n");
108 | if (g->what_segment(0) == GraphType::SOURCE)
109 | printf("node0 is in the SOURCE set\n");
110 | else
111 | printf("node0 is in the SINK set\n");
112 | if (g->what_segment(1) == GraphType::SOURCE)
113 | printf("node1 is in the SOURCE set\n");
114 | else
115 | printf("node1 is in the SINK set\n");
116 |
117 | delete g;
118 |
119 | return 0;
120 | }
121 |
122 |
123 | ///////////////////////////////////////////////////
124 |
--------------------------------------------------------------------------------
/annotationTools/scribble/segmentCPP/example.h:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | extern "C" {
5 |
6 | struct {
7 | uint8_t r;
8 | uint8_t g;
9 | uint8_t b;
10 | uint8_t a;
11 | } typedef Pixel;
12 |
13 | typedef Graph GraphType;
14 |
15 | void addBackgroundRect(uint8_t* imageData, int height, int width);
16 |
17 | int grabCut(uint8_t* imageData, uint8_t* scribbleData, int height, int width, int colorId);
18 |
19 | void setPixel(uint8_t* imageData, int height, int width, int i, int j, int r, int g, int b, int a);
20 |
21 | Pixel getPixel(uint8_t* imageData, int height, int width, int i, int j);
22 |
23 | GraphType *getGraph(uint8_t* imageData, uint8_t* scribbleData, int height, int width);
24 |
25 | void getProb(uint8_t *imageData, uint8_t *scribbleData, float probForeground[], int height, int width);
26 |
27 | int whatSegment(uint8_t *scribbleData, int height, int width, int i, int j);
28 |
29 | std::vector getTWeight(uint8_t *imageData, uint8_t *scribbleData, float *probForeground, int height, int width, int i, int j);
30 |
31 | int colorDist(Pixel px1, Pixel px2);
32 |
33 | int getNWeight(uint8_t *imageData, float beta, int height, int width, int i1, int j1, int i2, int j2);
34 |
35 | void setResult(GraphType *g, uint8_t *imageData, int height, int width, int colorId);
36 |
37 | float getBeta(uint8_t *imageData, int height, int width);
38 | }
39 |
--------------------------------------------------------------------------------
/annotationTools/scribble/segmentCPP/example.js.mem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationTools/scribble/segmentCPP/example.js.mem
--------------------------------------------------------------------------------
/annotationTools/scribble/segmentCPP/graph.cpp:
--------------------------------------------------------------------------------
1 | /* graph.cpp */
2 |
3 |
4 | #include
5 | #include
6 | #include
7 | #include "graph.h"
8 |
9 |
10 | template
11 | Graph::Graph(int node_num_max, int edge_num_max, void (*err_function)(char *))
12 | : node_num(0),
13 | nodeptr_block(NULL),
14 | error_function(err_function)
15 | {
16 | if (node_num_max < 16) node_num_max = 16;
17 | if (edge_num_max < 16) edge_num_max = 16;
18 |
19 | nodes = (node*) malloc(node_num_max*sizeof(node));
20 | arcs = (arc*) malloc(2*edge_num_max*sizeof(arc));
21 | if (!nodes || !arcs) { if (error_function) (*error_function)("Not enough memory!"); exit(1); }
22 |
23 | node_last = nodes;
24 | node_max = nodes + node_num_max;
25 | arc_last = arcs;
26 | arc_max = arcs + 2*edge_num_max;
27 |
28 | maxflow_iteration = 0;
29 | flow = 0;
30 | }
31 |
32 | template
33 | Graph::~Graph()
34 | {
35 | if (nodeptr_block)
36 | {
37 | delete nodeptr_block;
38 | nodeptr_block = NULL;
39 | }
40 | free(nodes);
41 | free(arcs);
42 | }
43 |
44 | template
45 | void Graph::reset()
46 | {
47 | node_last = nodes;
48 | arc_last = arcs;
49 | node_num = 0;
50 |
51 | if (nodeptr_block)
52 | {
53 | delete nodeptr_block;
54 | nodeptr_block = NULL;
55 | }
56 |
57 | maxflow_iteration = 0;
58 | flow = 0;
59 | }
60 |
61 | template
62 | void Graph::reallocate_nodes(int num)
63 | {
64 | int node_num_max = (int)(node_max - nodes);
65 | node* nodes_old = nodes;
66 |
67 | node_num_max += node_num_max / 2;
68 | if (node_num_max < node_num + num) node_num_max = node_num + num;
69 | nodes = (node*) realloc(nodes_old, node_num_max*sizeof(node));
70 | if (!nodes) { if (error_function) (*error_function)("Not enough memory!"); exit(1); }
71 |
72 | node_last = nodes + node_num;
73 | node_max = nodes + node_num_max;
74 |
75 | if (nodes != nodes_old)
76 | {
77 | arc* a;
78 | for (a=arcs; ahead = (node*) ((char*)a->head + (((char*) nodes) - ((char*) nodes_old)));
81 | }
82 | }
83 | }
84 |
85 | template
86 | void Graph::reallocate_arcs()
87 | {
88 | int arc_num_max = (int)(arc_max - arcs);
89 | int arc_num = (int)(arc_last - arcs);
90 | arc* arcs_old = arcs;
91 |
92 | arc_num_max += arc_num_max / 2; if (arc_num_max & 1) arc_num_max ++;
93 | arcs = (arc*) realloc(arcs_old, arc_num_max*sizeof(arc));
94 | if (!arcs) { if (error_function) (*error_function)("Not enough memory!"); exit(1); }
95 |
96 | arc_last = arcs + arc_num;
97 | arc_max = arcs + arc_num_max;
98 |
99 | if (arcs != arcs_old)
100 | {
101 | node* i;
102 | arc* a;
103 | for (i=nodes; ifirst) i->first = (arc*) ((char*)i->first + (((char*) arcs) - ((char*) arcs_old)));
106 | }
107 | for (a=arcs; anext) a->next = (arc*) ((char*)a->next + (((char*) arcs) - ((char*) arcs_old)));
110 | a->sister = (arc*) ((char*)a->sister + (((char*) arcs) - ((char*) arcs_old)));
111 | }
112 | }
113 | }
114 |
115 | #include "instances.inc"
116 |
--------------------------------------------------------------------------------
/annotationTools/scribble/segmentCPP/images/1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationTools/scribble/segmentCPP/images/1.jpg
--------------------------------------------------------------------------------
/annotationTools/scribble/segmentCPP/images/10.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationTools/scribble/segmentCPP/images/10.jpg
--------------------------------------------------------------------------------
/annotationTools/scribble/segmentCPP/images/11.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationTools/scribble/segmentCPP/images/11.jpg
--------------------------------------------------------------------------------
/annotationTools/scribble/segmentCPP/images/12.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationTools/scribble/segmentCPP/images/12.jpg
--------------------------------------------------------------------------------
/annotationTools/scribble/segmentCPP/images/13.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationTools/scribble/segmentCPP/images/13.jpg
--------------------------------------------------------------------------------
/annotationTools/scribble/segmentCPP/images/14.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationTools/scribble/segmentCPP/images/14.jpg
--------------------------------------------------------------------------------
/annotationTools/scribble/segmentCPP/images/15.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationTools/scribble/segmentCPP/images/15.jpg
--------------------------------------------------------------------------------
/annotationTools/scribble/segmentCPP/images/16.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationTools/scribble/segmentCPP/images/16.jpg
--------------------------------------------------------------------------------
/annotationTools/scribble/segmentCPP/images/17.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationTools/scribble/segmentCPP/images/17.jpg
--------------------------------------------------------------------------------
/annotationTools/scribble/segmentCPP/images/18.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationTools/scribble/segmentCPP/images/18.jpg
--------------------------------------------------------------------------------
/annotationTools/scribble/segmentCPP/images/19.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationTools/scribble/segmentCPP/images/19.jpg
--------------------------------------------------------------------------------
/annotationTools/scribble/segmentCPP/images/2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationTools/scribble/segmentCPP/images/2.jpg
--------------------------------------------------------------------------------
/annotationTools/scribble/segmentCPP/images/20.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationTools/scribble/segmentCPP/images/20.jpg
--------------------------------------------------------------------------------
/annotationTools/scribble/segmentCPP/images/21.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationTools/scribble/segmentCPP/images/21.jpg
--------------------------------------------------------------------------------
/annotationTools/scribble/segmentCPP/images/22.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationTools/scribble/segmentCPP/images/22.jpg
--------------------------------------------------------------------------------
/annotationTools/scribble/segmentCPP/images/3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationTools/scribble/segmentCPP/images/3.jpg
--------------------------------------------------------------------------------
/annotationTools/scribble/segmentCPP/images/4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationTools/scribble/segmentCPP/images/4.jpg
--------------------------------------------------------------------------------
/annotationTools/scribble/segmentCPP/images/5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationTools/scribble/segmentCPP/images/5.jpg
--------------------------------------------------------------------------------
/annotationTools/scribble/segmentCPP/images/6.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationTools/scribble/segmentCPP/images/6.jpg
--------------------------------------------------------------------------------
/annotationTools/scribble/segmentCPP/images/7.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationTools/scribble/segmentCPP/images/7.jpg
--------------------------------------------------------------------------------
/annotationTools/scribble/segmentCPP/images/8.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationTools/scribble/segmentCPP/images/8.jpg
--------------------------------------------------------------------------------
/annotationTools/scribble/segmentCPP/images/9.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationTools/scribble/segmentCPP/images/9.jpg
--------------------------------------------------------------------------------
/annotationTools/scribble/segmentCPP/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | Image segmentation
12 | If you see more than 2 boxes, make your window bigger (or zoom out) and then refresh the page
13 |
14 |
15 |
19 |
20 | Compute segmentation automatically after every edit?
21 |
25 | Compute
26 |
27 |
28 | Scribble Canvas
29 |
30 |
31 |
32 |
33 |
34 | Result Canvas
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/annotationTools/scribble/segmentCPP/instances.inc:
--------------------------------------------------------------------------------
1 | #include "graph.h"
2 |
3 | #ifdef _MSC_VER
4 | #pragma warning(disable: 4661)
5 | #endif
6 |
7 | // Instantiations:
8 | // IMPORTANT:
9 | // flowtype should be 'larger' than tcaptype
10 | // tcaptype should be 'larger' than captype
11 |
12 | template class Graph;
13 | template class Graph;
14 | template class Graph;
15 | template class Graph;
16 |
17 |
--------------------------------------------------------------------------------
/annotationTools/scribble/segmentCPP/main.js:
--------------------------------------------------------------------------------
1 | // Module.TOTAL_MEMORY = 40000000;
2 |
3 | grabCut = Module.cwrap(
4 | 'grabCut', 'number', ['number', 'number', 'number', 'number']
5 | );
6 |
7 | var scribbleMode = false;
8 | var mousePosition = {i: 0, j: 0};
9 | // var bins = 10;
10 | var numImages = 22
11 |
12 | $(document).ready(function() {
13 | $('#scribbleCanvas').mousedown(mouseDownCallback);
14 | $('#scribbleCanvas').mousemove(mouseMoveCallback);
15 | $('#scribbleCanvas').mouseup(mouseUpCallback);
16 | $('#compute').click(compute);
17 | $('input[name=mode]').click(hideButton);
18 | var imgNumber = Math.floor(numImages * Math.random()) + 1;
19 | // var imgNumber = 1;
20 | drawImageToCanvas('images/' + imgNumber + '.jpg');
21 | // drawImageToCanvas('coins.jpg')
22 | })
23 |
24 | function drawImageToCanvas(url) {
25 | var img = new Image();
26 | img.src = url;
27 | img.onload = function() {
28 | resizeCanvas(img)
29 | var context = $('#imageCanvas')[0].getContext('2d');
30 | context.drawImage(img, 0, 0, img.width, img.height);
31 | compute();
32 | }
33 | }
34 |
35 |
36 | function compute() {
37 | var imageData = getImageData('imageCanvas');
38 | var scribbleData = getImageData('scribbleCanvas');
39 |
40 | var size = imageData.data.length * imageData.data.BYTES_PER_ELEMENT;
41 | var imagePtr = Module._malloc(size);
42 | var scribblePtr = Module._malloc(size);
43 |
44 | // Copy data to Emscripten heap (directly accessed from Module.HEAPU8)
45 |
46 | var imageHeap = new Uint8Array(Module.HEAPU8.buffer, imagePtr, size);
47 | imageHeap.set(new Uint8Array(imageData.data.buffer));
48 |
49 | var scribbleHeap = new Uint8Array(Module.HEAPU8.buffer, scribblePtr, size);
50 | scribbleHeap.set(new Uint8Array(scribbleData.data.buffer));
51 |
52 | // Call function and get result
53 |
54 | var flow = grabCut(imageHeap.byteOffset, scribbleHeap.byteOffset, imageData.height, imageData.width);
55 |
56 | console.log('Flow(js):', flow);
57 |
58 | var resultData = new Uint8ClampedArray(imageHeap.buffer, imageHeap.byteOffset, imageData.data.length);
59 | // var resultData = new ImageData(resultData, imageData.width, imageData.height);
60 | var context = $('#resultCanvas')[0].getContext('2d');
61 | var resultImageData = context.createImageData(imageData.width, imageData.height);
62 | resultImageData.data.set(resultData);
63 |
64 |
65 | // Free memory
66 | Module._free(imageHeap.byteOffset);
67 | Module._free(scribbleHeap.byteOffset);
68 |
69 | drawResult(resultImageData);
70 | }
71 |
72 | function mouseDownCallback(e) {
73 | scribbleMode = true;
74 | var offsetX = $(this).position().left;
75 | var offsetY = $(this).position().top;
76 | mousePosition.i = Math.round(e.pageY - offsetY);
77 | mousePosition.j = Math.round(e.pageX - offsetX);
78 | }
79 |
80 | function mouseMoveCallback(e) {
81 | var offsetX = $(this).position().left;
82 | var offsetY = $(this).position().top;
83 | if (scribbleMode) {
84 | var i = Math.round(e.pageY - offsetY);
85 | var j = Math.round(e.pageX - offsetX);
86 | var context = $('#scribbleCanvas')[0].getContext('2d');
87 | context.beginPath()
88 | context.moveTo(mousePosition.j, mousePosition.i);
89 | context.lineTo(j, i);
90 | context.lineWidth = 3;
91 | var segment = $('input:radio[name=segment]:checked').val()
92 | if (segment == 'foreground') {
93 | context.strokeStyle = '#ff0000';
94 | } else {
95 | context.strokeStyle = '#00ff00';
96 | }
97 | context.stroke();
98 | mousePosition.i = i;
99 | mousePosition.j = j;
100 | }
101 | }
102 |
103 | function mouseUpCallback(e) {
104 | scribbleMode = false;
105 | // var scribbleData = getImageData('scribbleCanvas');
106 | var mode = $('input:radio[name=mode]:checked').val()
107 | if (mode == 'automatic') {
108 | compute();
109 | }
110 | }
111 |
112 | function resizeCanvas(image) {
113 | var canvases = $('canvas');
114 | for (var i = 0; i < canvases.length; i++) {
115 | canvases[i].height = image.height;
116 | canvases[i].width = image.width;
117 | }
118 |
119 | // move the scribbleCanvas on top of the imageCanvas
120 | var scribbleOffset = $('#scribbleCanvas').position()['left'];
121 | var imageOffset = $('#imageCanvas').position()['left'];
122 | $('#scribbleCanvas').css('left', imageOffset - scribbleOffset);
123 | }
124 |
125 | function getImageData(canvasName) {
126 | var canvas = $('#' + canvasName)[0]
127 | var context = canvas.getContext('2d');
128 | return context.getImageData(0, 0, canvas.width, canvas.height);
129 | }
130 |
131 | function drawResult(resultData) {
132 | var context = $('#resultCanvas')[0].getContext('2d');
133 | context.putImageData(resultData, 0, 0);
134 | }
135 |
136 | function hideButton() {
137 | var mode = $('input:radio[name=mode]:checked').val()
138 | if (mode == 'automatic') {
139 | $('#compute').hide();
140 | } else {
141 | $('#compute').show();
142 | }
143 | }
144 |
--------------------------------------------------------------------------------
/annotationTools/scribble/segmentCPP/style.css:
--------------------------------------------------------------------------------
1 | div {
2 | margin: 20px;
3 | /*height: 100%;
4 | width: 100%*/
5 | }
6 |
7 | canvas {
8 | border: solid;
9 | margin: 0;
10 | padding: 0;
11 | }
12 |
13 |
14 |
15 | canvas#scribbleCanvas {
16 | position: relative;
17 | }
18 |
19 | canvas#imageCanvas {
20 | }
21 |
--------------------------------------------------------------------------------
/annotationTools/scribble/segmentCPP/test.cpp:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | extern "C" {
4 | int float_multiply_array(float factor, float *arr, int length) {
5 | for (int i = 0; i < length; i++) {
6 | arr[i] = factor * arr[i];
7 | // std::cout << arr[i] << std::endl;
8 | }
9 | return 0;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/annotationTools/sh/anno_count.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # Make sure to run from "annotationTools/sh/" folder.
4 |
5 | j=0
6 | find ../../Annotations/ -name '*.xml' -printf %h/%f\\n | while read i; do
7 | j=$[$j+$(grep -o '' "$i" | wc -l)]
8 | echo $j > ../../annotationCache/counter_tmp
9 | done
10 | cp ../../annotationCache/counter_tmp ../../annotationCache/counter
11 |
12 | #find ./Annotations/ -name '*.xml' | xargs grep -o '' | wc -l > ./counter_tmp
13 | #cp ./counter_tmp ./counter
14 |
15 | #find ./Annotations/ -name '*.xml' | xargs grep -o '' | wc -l > ./counter
16 |
17 |
--------------------------------------------------------------------------------
/annotationTools/sh/api.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | jsdoc -d ./annotationTools/js/api $(echo "$(ls ./annotationTools/js/*.js | grep -v 'qunit-1.17.1.js\|jquery-1.9.1.js\|jquery-ui.js\|player.js\|video.js')")
3 |
--------------------------------------------------------------------------------
/annotationTools/sh/counter_loop.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | while ./anno_count.sh; do
3 | sleep 1m
4 | done
5 |
--------------------------------------------------------------------------------
/annotationTools/sh/populate_dirlist.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Populates list of images to label ("dirlist"). This list is stored
4 | # inside "/path/to/LabelMe/annotationCache/DirLists/".
5 | #
6 | # Make sure to run this script from "annotationTools/sh/" folder.
7 | # Otherwise, it will be necessary to modify HOMEIMAGES and HOMEDIRLIST
8 | # below.
9 | #
10 | # Example 1: Populate entire image database
11 | # $ cd /path/to/LabelMe/annotationTools/sh
12 | # $ ./populate_dirlist.sh
13 | #
14 | # Example 2: Create a new collection called "labelme2" and populate
15 | # subfolder "folder1":
16 | # $ cd /path/to/LabelMe/annotationTools/sh
17 | # $ ./populate_dirlist.sh labelme2.txt folder1
18 |
19 |
20 | # populate_dirlist.sh [dirlist.txt] [folder]
21 | #
22 | # dirlist.txt - Dirlist filename
23 | # folder - Sub-folder under root folder
24 |
25 | # Pointer to Images/ and DirLists/ directories:
26 | HOMEIMAGES='../../Images'
27 | HOMEDIRLIST='../../annotationCache/DirLists'
28 | HOMEVIDEOS='../../VLMFrames'
29 |
30 | # Inputs:
31 | dirlist=$1
32 | folder=$2
33 | videodirlist='labelmevideo.txt'
34 | # Handle empty input argument cases:
35 | if [ "$dirlist" == "" ]; then
36 | dirlist='labelme.txt';
37 |
38 | fi
39 |
40 | if [ "$folder" == "" ]; then
41 | ImageDir=$HOMEIMAGES;
42 | VideoDir=$HOMEVIDEOS;
43 | else
44 | ImageDir="$HOMEIMAGES/$folder";
45 | VideoDir="$HOMEVIDEOS/$folder";
46 | fi
47 |
48 | # Populate dirlist:
49 | find $ImageDir | while read i; do
50 | if [[ $i =~ ^.*\.jpg$ ]]; then
51 | # echo $i
52 | dname=$(dirname $i | sed -e s=$HOMEIMAGES/==);
53 | iname=$(basename $i);
54 | echo "$dname,$iname";
55 | echo "$dname,$iname" >> $HOMEDIRLIST/$dirlist;
56 | fi
57 | done
58 |
59 | # Populate dirlist:
60 | # ls $VideoDir | while read i; do
61 | # idname=$VideoDir$i;
62 | # ls $idname | while read j; do
63 | # dirn=$idname/$j;
64 | # dname=$i/$j;
65 | # ls $dirn | while read na; do
66 | # videoname=$(basename $na);
67 | # echo "$dname,$videoname";
68 | # echo "$dname,$videoname" >> $HOMEDIRLIST/$videodirlist;
69 | # done
70 | # done
71 | #done
72 |
73 |
74 |
75 |
--------------------------------------------------------------------------------
/annotationTools/video/convertxml.py:
--------------------------------------------------------------------------------
1 | import xml.etree.ElementTree as ET
2 | from collections import defaultdict
3 | import sys
4 |
5 | def serialize(elem):
6 | dictio = defaultdict(list)
7 | for frame in elem:
8 | dictioaux = defaultdict(list)
9 | for fields in frame:
10 | if len(fields) > 0:
11 | dictioaux[fields.tag].append(fields)
12 | else:
13 | dictioaux[fields.tag].append(fields.text)
14 | for i in dictioaux:
15 | dictio[i].append(dictioaux[i])
16 | return dictio
17 | # for key in dictio:
18 | # ET.SubElement(elem,"key").text = str(dictio[key])
19 |
20 | def formatcoords(arr):
21 | arr2 = [", ".join(myList) for myList in arr]
22 | arr3 = "; ".join(arr2)
23 | return arr3
24 |
25 | def formatcoordsbounding(arr):
26 | amax = map(max, arr)
27 | amin = map(min, arr)
28 | armax = ", ".join(amax)
29 | armin = ", ".join(amin)
30 | return [armin, armax]
31 |
32 |
33 | filename = sys.argv[1]
34 | polygons_enabled = True
35 |
36 | tree = ET.parse(filename+'.xml')
37 | root = tree.getroot()
38 | framedict = serialize(root[0])
39 | [root[0].remove(a) for a in root[0].findall('fr')]
40 | fr = ET.SubElement(root[0], 'fr')
41 | for key in framedict:
42 | val = ", ".join(sum(framedict[key],[]))
43 | print val
44 | ET.SubElement(fr,key).text = val
45 |
46 |
47 |
48 | for objectelem in root.findall('object'):
49 | dictio = serialize(objectelem)
50 | tf = ", ".join(sum(dictio['t'],[]))
51 | xf = []
52 | yf = []
53 | lf = []
54 | for polygonpt in dictio['pt']:
55 | xf.append([o[0].text for o in polygonpt])
56 | yf.append([o[1].text for o in polygonpt])
57 | lf.append([o[2].text for o in polygonpt])
58 | [objectelem.remove(a) for a in objectelem.findall('polygon')]
59 | pol = ET.SubElement(objectelem, 'polygon')
60 | ET.SubElement(pol,'t').text = tf
61 | ET.SubElement(pol,'l').text = formatcoords(lf)
62 | if polygons_enabled:
63 | ET.SubElement(pol,'x').text = formatcoords(xf)
64 | ET.SubElement(pol,'y').text = formatcoords(yf)
65 | else:
66 | ET.SubElement(pol,'xmax').text = formatcoordsbounding(xf)[1]
67 | ET.SubElement(pol,'xmin').text = formatcoordsbounding(yf)[0]
68 | ET.SubElement(pol,'ymax').text = formatcoordsbounding(xf)[1]
69 | ET.SubElement(pol,'ymin').text = formatcoordsbounding(yf)[0]
70 |
71 |
72 |
73 | tree.write(filename+'2.xml')
74 |
75 |
76 |
--------------------------------------------------------------------------------
/annotationTools/video/demo.xhtml:
--------------------------------------------------------------------------------
1 |
4 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/annotationTools/video/icons/boundingbox.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationTools/video/icons/boundingbox.png
--------------------------------------------------------------------------------
/annotationTools/video/icons/pause.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationTools/video/icons/pause.jpg
--------------------------------------------------------------------------------
/annotationTools/video/icons/play.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationTools/video/icons/play.jpg
--------------------------------------------------------------------------------
/annotationTools/video/icons/scrollposition.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationTools/video/icons/scrollposition.png
--------------------------------------------------------------------------------
/annotationTools/video/icons/video_beginning.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationTools/video/icons/video_beginning.png
--------------------------------------------------------------------------------
/annotationTools/video/icons/video_end.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationTools/video/icons/video_end.png
--------------------------------------------------------------------------------
/annotationTools/video/icons/video_pause.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationTools/video/icons/video_pause.png
--------------------------------------------------------------------------------
/annotationTools/video/icons/video_play.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationTools/video/icons/video_play.png
--------------------------------------------------------------------------------
/annotationTools/video/icons/video_stepback.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationTools/video/icons/video_stepback.png
--------------------------------------------------------------------------------
/annotationTools/video/icons/video_stepforward.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSAILVision/LabelMeAnnotationTool/99e70d42c2cdfc3e3886a07fbafe702466451f22/annotationTools/video/icons/video_stepforward.png
--------------------------------------------------------------------------------
/unit_tests.html:
--------------------------------------------------------------------------------
1 |
4 |
7 |
8 |
9 | QUnit Example
10 |
11 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------