├── whats_the_point ├── pascal_images │ ├── 2010_003526.jpg │ ├── 2010_004385.jpg │ ├── 2010_005016.jpg │ ├── 2011_000068.jpg │ └── 2011_000269.jpg ├── timer.js ├── sample_input.js ├── draw_box_instructions.html ├── point_task_once.js ├── point_task.js ├── draw_box_task.js ├── utils.js ├── carosel.js ├── point-drawer.js ├── point-drawer-once.js ├── all_actions.html └── bbox-drawer.js ├── best_of_both_worlds ├── examples │ ├── ILSVRC2012_val_00000379.JPEG │ ├── ILSVRC2012_val_00000694.JPEG │ ├── ILSVRC2012_val_00001937.JPEG │ ├── ILSVRC2012_val_00002315.JPEG │ ├── ILSVRC2012_val_00002773.JPEG │ ├── bad_ILSVRC2012_val_00000006.JPEG │ ├── bad_ILSVRC2012_val_00000018.JPEG │ ├── bad_ILSVRC2012_val_00000115.JPEG │ ├── bad_ILSVRC2012_val_00000379.JPEG │ ├── bad_ILSVRC2012_val_00000694.JPEG │ ├── bad_ILSVRC2012_val_00001929.JPEG │ ├── bad_ILSVRC2012_val_00001937.JPEG │ ├── bad_ILSVRC2012_val_00002315.JPEG │ ├── bad_ILSVRC2012_val_00002656.JPEG │ ├── bad_ILSVRC2012_val_00002773.JPEG │ ├── bad_ILSVRC2012_val_00002988.JPEG │ ├── good_ILSVRC2012_val_00000350.JPEG │ ├── good_ILSVRC2012_val_00000379.JPEG │ ├── good_ILSVRC2012_val_00000694.JPEG │ ├── good_ILSVRC2012_val_00001937.JPEG │ ├── good_ILSVRC2012_val_00002315.JPEG │ ├── good_ILSVRC2012_val_00002773.JPEG │ ├── good_ILSVRC2012_val_00002988.JPEG │ ├── OK_53_ILSVRC2012_val_00000115.JPEG │ ├── OK_53_ILSVRC2012_val_00000643.JPEG │ ├── OK_55_ILSVRC2012_val_00000668.JPEG │ ├── OK_57_ILSVRC2012_val_00000147.JPEG │ ├── OK_65_ILSVRC2012_val_00000350.JPEG │ ├── OK_66_ILSVRC2012_val_00000141.JPEG │ ├── OK_66_ILSVRC2012_val_00000174.JPEG │ ├── OK_70_ILSVRC2012_val_00000057.JPEG │ ├── OK_70_ILSVRC2012_val_00000203.JPEG │ ├── OK_71_ILSVRC2012_val_00000748.JPEG │ ├── OK_72_ILSVRC2012_val_00000643.JPEG │ ├── OK_72_ILSVRC2012_val_00000719.JPEG │ ├── OK_73_ILSVRC2012_val_00000694.JPEG │ ├── OK_74_ILSVRC2012_val_00000668.JPEG │ ├── OK_74_ILSVRC2012_val_00000696.JPEG │ ├── bad_32_ILSVRC2012_val_00001286.JPEG │ ├── bad_33_ILSVRC2012_val_00001624.JPEG │ ├── bad_37_ILSVRC2012_val_00001550.JPEG │ ├── bad_39_ILSVRC2012_val_00001297.JPEG │ ├── bad_39_ILSVRC2012_val_00001957.JPEG │ └── bad_40_ILSVRC2012_val_00001686.JPEG ├── verify_box_instructions.html ├── verify_object_instructions.html ├── verify_cover_instructions.html ├── verify_image_instructions.js ├── verify_image_instructions.html ├── timer.js ├── write_class_instructions.html ├── write_name_instructions.html ├── draw_box_instructions.html ├── verify_image_task.js ├── task_header.js ├── verify_object_task.js ├── verify_box_task.js ├── verify_cover_task.js ├── write_name_task.js ├── sample_input.js ├── write_class_task.js ├── binary_input.js ├── draw_box_task.js ├── utils.js ├── text_input.js ├── instructions.html ├── carosel.js ├── all_actions.html ├── bbox-drawer.js └── verify_tags.html ├── LICENSE └── README.md /whats_the_point/pascal_images/2010_003526.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/whats_the_point/pascal_images/2010_003526.jpg -------------------------------------------------------------------------------- /whats_the_point/pascal_images/2010_004385.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/whats_the_point/pascal_images/2010_004385.jpg -------------------------------------------------------------------------------- /whats_the_point/pascal_images/2010_005016.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/whats_the_point/pascal_images/2010_005016.jpg -------------------------------------------------------------------------------- /whats_the_point/pascal_images/2011_000068.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/whats_the_point/pascal_images/2011_000068.jpg -------------------------------------------------------------------------------- /whats_the_point/pascal_images/2011_000269.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/whats_the_point/pascal_images/2011_000269.jpg -------------------------------------------------------------------------------- /best_of_both_worlds/examples/ILSVRC2012_val_00000379.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/best_of_both_worlds/examples/ILSVRC2012_val_00000379.JPEG -------------------------------------------------------------------------------- /best_of_both_worlds/examples/ILSVRC2012_val_00000694.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/best_of_both_worlds/examples/ILSVRC2012_val_00000694.JPEG -------------------------------------------------------------------------------- /best_of_both_worlds/examples/ILSVRC2012_val_00001937.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/best_of_both_worlds/examples/ILSVRC2012_val_00001937.JPEG -------------------------------------------------------------------------------- /best_of_both_worlds/examples/ILSVRC2012_val_00002315.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/best_of_both_worlds/examples/ILSVRC2012_val_00002315.JPEG -------------------------------------------------------------------------------- /best_of_both_worlds/examples/ILSVRC2012_val_00002773.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/best_of_both_worlds/examples/ILSVRC2012_val_00002773.JPEG -------------------------------------------------------------------------------- /best_of_both_worlds/examples/bad_ILSVRC2012_val_00000006.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/best_of_both_worlds/examples/bad_ILSVRC2012_val_00000006.JPEG -------------------------------------------------------------------------------- /best_of_both_worlds/examples/bad_ILSVRC2012_val_00000018.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/best_of_both_worlds/examples/bad_ILSVRC2012_val_00000018.JPEG -------------------------------------------------------------------------------- /best_of_both_worlds/examples/bad_ILSVRC2012_val_00000115.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/best_of_both_worlds/examples/bad_ILSVRC2012_val_00000115.JPEG -------------------------------------------------------------------------------- /best_of_both_worlds/examples/bad_ILSVRC2012_val_00000379.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/best_of_both_worlds/examples/bad_ILSVRC2012_val_00000379.JPEG -------------------------------------------------------------------------------- /best_of_both_worlds/examples/bad_ILSVRC2012_val_00000694.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/best_of_both_worlds/examples/bad_ILSVRC2012_val_00000694.JPEG -------------------------------------------------------------------------------- /best_of_both_worlds/examples/bad_ILSVRC2012_val_00001929.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/best_of_both_worlds/examples/bad_ILSVRC2012_val_00001929.JPEG -------------------------------------------------------------------------------- /best_of_both_worlds/examples/bad_ILSVRC2012_val_00001937.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/best_of_both_worlds/examples/bad_ILSVRC2012_val_00001937.JPEG -------------------------------------------------------------------------------- /best_of_both_worlds/examples/bad_ILSVRC2012_val_00002315.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/best_of_both_worlds/examples/bad_ILSVRC2012_val_00002315.JPEG -------------------------------------------------------------------------------- /best_of_both_worlds/examples/bad_ILSVRC2012_val_00002656.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/best_of_both_worlds/examples/bad_ILSVRC2012_val_00002656.JPEG -------------------------------------------------------------------------------- /best_of_both_worlds/examples/bad_ILSVRC2012_val_00002773.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/best_of_both_worlds/examples/bad_ILSVRC2012_val_00002773.JPEG -------------------------------------------------------------------------------- /best_of_both_worlds/examples/bad_ILSVRC2012_val_00002988.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/best_of_both_worlds/examples/bad_ILSVRC2012_val_00002988.JPEG -------------------------------------------------------------------------------- /best_of_both_worlds/examples/good_ILSVRC2012_val_00000350.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/best_of_both_worlds/examples/good_ILSVRC2012_val_00000350.JPEG -------------------------------------------------------------------------------- /best_of_both_worlds/examples/good_ILSVRC2012_val_00000379.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/best_of_both_worlds/examples/good_ILSVRC2012_val_00000379.JPEG -------------------------------------------------------------------------------- /best_of_both_worlds/examples/good_ILSVRC2012_val_00000694.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/best_of_both_worlds/examples/good_ILSVRC2012_val_00000694.JPEG -------------------------------------------------------------------------------- /best_of_both_worlds/examples/good_ILSVRC2012_val_00001937.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/best_of_both_worlds/examples/good_ILSVRC2012_val_00001937.JPEG -------------------------------------------------------------------------------- /best_of_both_worlds/examples/good_ILSVRC2012_val_00002315.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/best_of_both_worlds/examples/good_ILSVRC2012_val_00002315.JPEG -------------------------------------------------------------------------------- /best_of_both_worlds/examples/good_ILSVRC2012_val_00002773.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/best_of_both_worlds/examples/good_ILSVRC2012_val_00002773.JPEG -------------------------------------------------------------------------------- /best_of_both_worlds/examples/good_ILSVRC2012_val_00002988.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/best_of_both_worlds/examples/good_ILSVRC2012_val_00002988.JPEG -------------------------------------------------------------------------------- /best_of_both_worlds/examples/OK_53_ILSVRC2012_val_00000115.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/best_of_both_worlds/examples/OK_53_ILSVRC2012_val_00000115.JPEG -------------------------------------------------------------------------------- /best_of_both_worlds/examples/OK_53_ILSVRC2012_val_00000643.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/best_of_both_worlds/examples/OK_53_ILSVRC2012_val_00000643.JPEG -------------------------------------------------------------------------------- /best_of_both_worlds/examples/OK_55_ILSVRC2012_val_00000668.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/best_of_both_worlds/examples/OK_55_ILSVRC2012_val_00000668.JPEG -------------------------------------------------------------------------------- /best_of_both_worlds/examples/OK_57_ILSVRC2012_val_00000147.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/best_of_both_worlds/examples/OK_57_ILSVRC2012_val_00000147.JPEG -------------------------------------------------------------------------------- /best_of_both_worlds/examples/OK_65_ILSVRC2012_val_00000350.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/best_of_both_worlds/examples/OK_65_ILSVRC2012_val_00000350.JPEG -------------------------------------------------------------------------------- /best_of_both_worlds/examples/OK_66_ILSVRC2012_val_00000141.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/best_of_both_worlds/examples/OK_66_ILSVRC2012_val_00000141.JPEG -------------------------------------------------------------------------------- /best_of_both_worlds/examples/OK_66_ILSVRC2012_val_00000174.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/best_of_both_worlds/examples/OK_66_ILSVRC2012_val_00000174.JPEG -------------------------------------------------------------------------------- /best_of_both_worlds/examples/OK_70_ILSVRC2012_val_00000057.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/best_of_both_worlds/examples/OK_70_ILSVRC2012_val_00000057.JPEG -------------------------------------------------------------------------------- /best_of_both_worlds/examples/OK_70_ILSVRC2012_val_00000203.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/best_of_both_worlds/examples/OK_70_ILSVRC2012_val_00000203.JPEG -------------------------------------------------------------------------------- /best_of_both_worlds/examples/OK_71_ILSVRC2012_val_00000748.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/best_of_both_worlds/examples/OK_71_ILSVRC2012_val_00000748.JPEG -------------------------------------------------------------------------------- /best_of_both_worlds/examples/OK_72_ILSVRC2012_val_00000643.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/best_of_both_worlds/examples/OK_72_ILSVRC2012_val_00000643.JPEG -------------------------------------------------------------------------------- /best_of_both_worlds/examples/OK_72_ILSVRC2012_val_00000719.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/best_of_both_worlds/examples/OK_72_ILSVRC2012_val_00000719.JPEG -------------------------------------------------------------------------------- /best_of_both_worlds/examples/OK_73_ILSVRC2012_val_00000694.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/best_of_both_worlds/examples/OK_73_ILSVRC2012_val_00000694.JPEG -------------------------------------------------------------------------------- /best_of_both_worlds/examples/OK_74_ILSVRC2012_val_00000668.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/best_of_both_worlds/examples/OK_74_ILSVRC2012_val_00000668.JPEG -------------------------------------------------------------------------------- /best_of_both_worlds/examples/OK_74_ILSVRC2012_val_00000696.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/best_of_both_worlds/examples/OK_74_ILSVRC2012_val_00000696.JPEG -------------------------------------------------------------------------------- /best_of_both_worlds/examples/bad_32_ILSVRC2012_val_00001286.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/best_of_both_worlds/examples/bad_32_ILSVRC2012_val_00001286.JPEG -------------------------------------------------------------------------------- /best_of_both_worlds/examples/bad_33_ILSVRC2012_val_00001624.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/best_of_both_worlds/examples/bad_33_ILSVRC2012_val_00001624.JPEG -------------------------------------------------------------------------------- /best_of_both_worlds/examples/bad_37_ILSVRC2012_val_00001550.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/best_of_both_worlds/examples/bad_37_ILSVRC2012_val_00001550.JPEG -------------------------------------------------------------------------------- /best_of_both_worlds/examples/bad_39_ILSVRC2012_val_00001297.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/best_of_both_worlds/examples/bad_39_ILSVRC2012_val_00001297.JPEG -------------------------------------------------------------------------------- /best_of_both_worlds/examples/bad_39_ILSVRC2012_val_00001957.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/best_of_both_worlds/examples/bad_39_ILSVRC2012_val_00001957.JPEG -------------------------------------------------------------------------------- /best_of_both_worlds/examples/bad_40_ILSVRC2012_val_00001686.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orussakovsky/annotation-UIs/HEAD/best_of_both_worlds/examples/bad_40_ILSVRC2012_val_00001686.JPEG -------------------------------------------------------------------------------- /best_of_both_worlds/verify_box_instructions.html: -------------------------------------------------------------------------------- 1 |

Please decide if the provided box is a good bounding box around a single instance of the specified object. 2 | See the examples below to learn what is considered a good bounding box.

3 | 4 | -------------------------------------------------------------------------------- /best_of_both_worlds/verify_object_instructions.html: -------------------------------------------------------------------------------- 1 |

Please decide if the provided box is a good bounding box around a single instance of some object (for example, it is a good bounding box around one cat, or one person, or one screwdriver, or one instance of any other object). 2 | See the examples below to learn what is considered a good bounding box.

3 | 4 | -------------------------------------------------------------------------------- /best_of_both_worlds/verify_cover_instructions.html: -------------------------------------------------------------------------------- 1 | Please check if there is a good blue bounding box around every instance of the specified object. 2 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /best_of_both_worlds/verify_image_instructions.js: -------------------------------------------------------------------------------- 1 | Please decide if the specified object is present in the image: 2 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /best_of_both_worlds/verify_image_instructions.html: -------------------------------------------------------------------------------- 1 | Please decide if the specified object is present in the image: 2 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /whats_the_point/timer.js: -------------------------------------------------------------------------------- 1 | var VG = (function(vg) { 2 | vg.Timer = function() { 3 | var that = (this === vg ? {} : this); 4 | var start_t = 0; 5 | var total_t = 0; 6 | 7 | that.start = function() { 8 | start_t = new Date().getTime(); 9 | } 10 | 11 | that.stop = function() { 12 | if (start_t > 0) { 13 | total_t += new Date().getTime()-start_t; 14 | start_t = 0; 15 | } 16 | } 17 | 18 | that.total = function () { 19 | if (start_t > 0) 20 | return total_t + new Date().getTime()-start_t; 21 | else 22 | return total_t; 23 | } 24 | 25 | return that; 26 | } 27 | 28 | return vg; 29 | 30 | }(VG || {})); 31 | -------------------------------------------------------------------------------- /best_of_both_worlds/timer.js: -------------------------------------------------------------------------------- 1 | var VG = (function(vg) { 2 | vg.Timer = function() { 3 | var that = (this === vg ? {} : this); 4 | var start_t = 0; 5 | var total_t = 0; 6 | 7 | that.start = function() { 8 | start_t = new Date().getTime(); 9 | } 10 | 11 | that.stop = function() { 12 | if (start_t > 0) { 13 | total_t += new Date().getTime()-start_t; 14 | start_t = 0; 15 | } 16 | } 17 | 18 | that.total = function () { 19 | if (start_t > 0) 20 | return total_t + new Date().getTime()-start_t; 21 | else 22 | return total_t; 23 | } 24 | 25 | return that; 26 | } 27 | 28 | return vg; 29 | 30 | }(VG || {})); 31 | -------------------------------------------------------------------------------- /best_of_both_worlds/write_class_instructions.html: -------------------------------------------------------------------------------- 1 | Please write the name of any object that is in the image but is not listed. 2 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /best_of_both_worlds/write_name_instructions.html: -------------------------------------------------------------------------------- 1 |

First, please see the examples below to learn what is considered a good bounding box around an object.

2 | 5 |

If the blue box is good, please type in the name of the object within it:

6 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /whats_the_point/sample_input.js: -------------------------------------------------------------------------------- 1 | var VG = (function(vg) { 2 | 3 | vg.SampleInput = function() { 4 | var that = (this === vg ? {} : this); 5 | 6 | that.get = function(index) { 7 | if (!index) { 8 | // IMPORTANT: before submitting to AMT, make sure all image_urls are absolute paths, e.g., 9 | // "image_url": "//image-net.org/path/to/images/" 10 | // 11 | return {"questions": [{"img_id": "2011_000269","image_url": "pascal_images/2011_000269.jpg"},{"img_id": "2010_004385","image_url": "pascal_images/2010_004385.jpg"},{"img_id": "2011_000068","image_url": "pascal_images/2011_000068.jpg"},{"img_id": "2010_003526","image_url": "pascal_images/2010_003526.jpg","gt": {"bbox": {"x": 115,"y": 130,"w": 224,"h": 245},"num_min": 1,"num_max": 1}},{"img_id": "2010_005016","image_url": "pascal_images/2010_005016.jpg"}],"accuracy": 0.85,"object_name": "bird","object_plural": "birds"}; 12 | } 13 | 14 | } 15 | 16 | return that; 17 | } 18 | 19 | return vg; 20 | 21 | }(VG || {})); 22 | -------------------------------------------------------------------------------- /whats_the_point/draw_box_instructions.html: -------------------------------------------------------------------------------- 1 |

Please draw a tight bounding box around one new instance of the specified object class. See the examples below to learn what is considered a good bounding box.

2 | 3 |

If there are yellow boxes on the image:

4 | 9 | 10 |

Click the 'Click here if no box can be drawn' button if:

11 |
    12 |
  1. The object is not present in the image, or 13 |
  2. The object is present but all instances are already correctly annotated by yellow boxes, or 14 |
  3. The only remaining unannotated instances are so close to existing yellow boxes that the system will not let you draw a box around them by giving a 'Too close to existing box' error. 15 | 16 |
17 | 18 | -------------------------------------------------------------------------------- /best_of_both_worlds/draw_box_instructions.html: -------------------------------------------------------------------------------- 1 |

Please draw a tight bounding box around one new instance of the specified object class. See the examples below to learn what is considered a good bounding box.

2 | 3 |

If there are yellow boxes on the image:

4 | 9 | 10 |

Click the 'Click here if no box can be drawn' button if:

11 |
    12 |
  1. The object is not present in the image, or 13 |
  2. The object is present but all instances are already correctly annotated by yellow boxes, or 14 |
  3. The only remaining unannotated instances are so close to existing yellow boxes that the system will not let you draw a box around them by giving a 'Too close to existing box' error. 15 | 16 |
17 | 18 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Stanford University 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /best_of_both_worlds/verify_image_task.js: -------------------------------------------------------------------------------- 1 | var VG = (function(vg) { 2 | vg.VerifyImageTask = function(container_div,task_input) { 3 | var that = (this === vg ? {} : this); 4 | var enabled = false; 5 | 6 | var image_url = task_input.image_url; 7 | 8 | var task_name = "Is this object present in the image:"; 9 | 10 | var ti_options = {object_name: task_input.object_name, 11 | instructions_url: "verify_image_instructions.html" 12 | } 13 | 14 | var ui_div = VG.TaskInstructions(container_div,task_name,ti_options).GetInputDiv(); 15 | 16 | var img_div = $('').attr('src',image_url).appendTo(ui_div); 17 | 18 | binput_info = {gt:task_input.gt}; 19 | var binput = new VG.BinaryInput(ui_div,binput_info); 20 | 21 | var timer = new VG.Timer(); 22 | 23 | that.GetAnswerIfValid = function () { 24 | return {'answer': binput.GetAnswer(), 25 | 'time':timer.total(), 26 | 'eval':binput.EvalAnswer()}; 27 | } 28 | 29 | that.enable = function() { 30 | enabled = true; 31 | binput.enable(); 32 | timer.start(); 33 | } 34 | 35 | that.disable = function() { 36 | enabled = false; 37 | binput.disable(); 38 | timer.stop(); 39 | } 40 | 41 | that.disable(); 42 | 43 | return that; 44 | } 45 | 46 | return vg; 47 | 48 | }(VG || {})); 49 | -------------------------------------------------------------------------------- /whats_the_point/point_task_once.js: -------------------------------------------------------------------------------- 1 | var VG = (function(vg) { 2 | //task_input must have: 3 | // image_url, obj_name, obj_plural, gt.bbox, gt.min_num, gt.max_num 4 | vg.PointTaskOnce = function(container_div,task_input) { 5 | var that = (this === vg ? {} : this); 6 | var enabled = false; 7 | 8 | var image_url = task_input.image_url; 9 | 10 | var drawer_div = $('
').appendTo(container_div); 11 | 12 | VIEWPORT_HEIGHT = 500; 13 | 14 | var max_height = VIEWPORT_HEIGHT; 15 | max_height -= $('#task-instr-div').height(); 16 | max_height -= $('#c-buttons-div').height(); 17 | var images_div = $('#c-imgs-div'); 18 | var bbox_drawer_options = { 19 | max_height: max_height, 20 | max_width: images_div.width(), 21 | 22 | gt: task_input.gt, 23 | obj_singular: task_input.obj_name, 24 | }; 25 | var bbox_drawer = new VG.PointDrawerOnce(drawer_div,image_url,null,bbox_drawer_options); 26 | 27 | var timer = new VG.Timer(); 28 | 29 | that.GetAnswerIfValid = function () { 30 | return {'answer': bbox_drawer.GetAnswer(), 31 | 'time':timer.total(), 32 | 'eval':bbox_drawer.EvalAnswer()}; 33 | } 34 | 35 | that.enable = function() { 36 | enabled = true; 37 | bbox_drawer.enable(); 38 | timer.start(); 39 | } 40 | 41 | that.disable = function() { 42 | enabled = false; 43 | bbox_drawer.disable(); 44 | timer.stop(); 45 | } 46 | 47 | that.disable(); 48 | 49 | return that; 50 | } 51 | 52 | return vg; 53 | 54 | }(VG || {})); 55 | -------------------------------------------------------------------------------- /best_of_both_worlds/task_header.js: -------------------------------------------------------------------------------- 1 | var VG = (function(vg) { 2 | DEFAULT_OPTIONS = {object_name: null, 3 | instructions: null, 4 | instructions_url: null}; 5 | 6 | vg.TaskInstructions = function(container_div,task_name,options) { 7 | var that = (this === vg ? {} : this); 8 | 9 | options = vg.merge_options(options,DEFAULT_OPTIONS); 10 | 11 | var top_div = $('
').appendTo(container_div); 12 | var middle_div = $('
').appendTo(container_div); 13 | var bottom_div = $('
').addClass('text-left').appendTo(container_div); 14 | 15 | $('
').addClass('task-instr-title').text(task_name).appendTo(top_div); 16 | if (options.object_name != null) { 17 | $('
').addClass('task-instr-clsname') 18 | .text(options.object_name) 19 | .appendTo(top_div); 20 | } 21 | 22 | if (options.instructions != null || options.instructions_url != null) { 23 | $('
').appendTo(bottom_div); 24 | $('

').text('Instructions:').appendTo(bottom_div); 25 | 26 | if (options.instructions != null) { 27 | $('
').addClass('task-instr-text') 28 | .text(options.instructions).appendTo(bottom_div); 29 | } 30 | if (options.instructions_url != null) { 31 | // IMPORTANT: put in absolute rather than relative path 32 | $('
').addClass('task-instr-text').load('' + options.instructions_url).appendTo(bottom_div); 33 | } 34 | } 35 | 36 | that.GetInputDiv = function() { 37 | return middle_div; 38 | } 39 | 40 | return that; 41 | } 42 | 43 | return vg; 44 | 45 | }(VG || {})); 46 | -------------------------------------------------------------------------------- /whats_the_point/point_task.js: -------------------------------------------------------------------------------- 1 | var VG = (function(vg) { 2 | //task_input must have: 3 | // image_url, obj_name, obj_plural, gt.bbox, gt.min_num, gt.max_num 4 | vg.PointTask = function(container_div,task_input) { 5 | var that = (this === vg ? {} : this); 6 | var enabled = false; 7 | 8 | var image_url = task_input.image_url; 9 | 10 | var drawer_div = $('
').appendTo(container_div); 11 | 12 | VIEWPORT_HEIGHT = 500; 13 | 14 | var max_height = VIEWPORT_HEIGHT; 15 | max_height -= $('#task-instr-div').height(); 16 | max_height -= $('#c-buttons-div').height(); 17 | var images_div = $('#c-imgs-div'); 18 | var bbox_drawer_options = { 19 | max_height: max_height, 20 | max_width: images_div.width(), 21 | 22 | gt: task_input.gt, 23 | obj_singular: task_input.obj_name, 24 | obj_plural: task_input.obj_plural 25 | }; 26 | var bbox_drawer = new VG.PointDrawer(drawer_div,image_url,null,bbox_drawer_options); 27 | 28 | var timer = new VG.Timer(); 29 | 30 | that.GetAnswerIfValid = function () { 31 | return {'answer': bbox_drawer.GetAnswer(), 32 | 'time':timer.total(), 33 | 'eval':bbox_drawer.EvalAnswer()}; 34 | } 35 | 36 | that.enable = function() { 37 | enabled = true; 38 | bbox_drawer.enable(); 39 | timer.start(); 40 | } 41 | 42 | that.disable = function() { 43 | enabled = false; 44 | bbox_drawer.disable(); 45 | timer.stop(); 46 | } 47 | 48 | that.disable(); 49 | 50 | return that; 51 | } 52 | 53 | return vg; 54 | 55 | }(VG || {})); 56 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # annotation-UIs 2 | 3 | This repository contains image annotation UIs used for various projects at Stanford University. 4 | 5 | Authors: [Olga Russakovsky](http://cs.cmu.edu/~orussako) (olga@cs.stanford.edu) and [Justin Johnson](http://cs.stanford.edu/people/jcjohns/) 6 | 7 | ### Entrypoint 8 | 9 | The entry point for the UIs is all_actions.html. You can open it in your browser to see a set of sample tasks and check out the UIs. 10 | 11 | ### Annotating images on Amazon Machanical Turk 12 | 13 | The simplest backend to use with these templates is [simple-amt](https://github.com/jcjohnson/simple-amt) 14 | 15 | **Important**: make sure to put in absolute rather than relative paths, e.g., 16 | 17 | //image-net.org/path/to/you/file 18 | 19 | Search for 'absolute' in the code -- most places should be marked with comments. You'll need to do it in 20 | - best_of_both_world/all_actions.html 21 | - best_of_both_worlds/instructions.html 22 | - best_of_both_worlds/task_header.js 23 | - whats_the_point/all_actions.html 24 | - all image paths 25 | 26 | ### References 27 | 28 | If you find the UIs useful in your research, please cite: 29 | 30 | **best_of_both_worlds** 31 | 32 | Project page: http://ai.stanford.edu/~olga/best_of_both_worlds 33 | 34 | @inproceedings{RussakovskyCVPR15, 35 | author = {Olga Russakovsky and Li-Jia Li and Li Fei-Fei}, 36 | title = {Best of both worlds: human-machine collaboration for object annotation}, 37 | booktitle = {CVPR}, 38 | year = {2015} 39 | } 40 | 41 | **whats_the_point** 42 | 43 | Project page: http://vision.stanford.edu/whats_the_point 44 | 45 | @article{Bearman15, 46 | author = {Amy Bearman and Olga Russakovsky and Vittorio Ferrari and Li Fei-Fei}, 47 | title = {What's the point: Semantic segmentation with point supervision}, 48 | journal = {ArXiv e-prints}, 49 | eprint = {1506.02106}, 50 | year = {2015} 51 | } 52 | 53 | -------------------------------------------------------------------------------- /best_of_both_worlds/verify_object_task.js: -------------------------------------------------------------------------------- 1 | var VG = (function(vg) { 2 | vg.VerifyObjectTask = function(container_div,task_input) { 3 | var that = (this === vg ? {} : this); 4 | var enabled = false; 5 | 6 | var image_url = task_input.image_url; 7 | var box = task_input.box; 8 | 9 | var task_name = "Is this a good box around AN object?"; 10 | 11 | var ti_options = {instructions_url: "verify_object_instructions.html" 12 | } 13 | 14 | var ui_div = VG.TaskInstructions(container_div,task_name,ti_options).GetInputDiv(); 15 | 16 | var drawer_div = $('
').appendTo(ui_div); 17 | 18 | binput_options = { 19 | pos_button_name: 'Yes, it is a good box', 20 | neg_button_name: 'No, it is not a good box', 21 | gt: task_input.gt 22 | } 23 | 24 | VIEWPORT_HEIGHT = 500; 25 | 26 | var max_height = VIEWPORT_HEIGHT; 27 | max_height -= $('#task-instr-div').height(); 28 | max_height -= $('#c-buttons-div').height(); 29 | var images_div = $('#c-imgs-div'); 30 | var bbox_drawer_options = { 31 | max_height: max_height, 32 | max_width: images_div.width(), 33 | static_box_color: 'blue' 34 | }; 35 | var bbox_drawer = new VG.BBoxDrawer(drawer_div,image_url,null,bbox_drawer_options); 36 | bbox_drawer.addStaticBox(box); 37 | 38 | var binput = new VG.BinaryInput(ui_div,binput_options); 39 | 40 | 41 | var timer = new VG.Timer(); 42 | 43 | that.GetAnswerIfValid = function () { 44 | return {'answer': binput.GetAnswer(), 45 | 'time':timer.total(), 46 | 'eval':binput.EvalAnswer()}; 47 | } 48 | 49 | that.enable = function() { 50 | enabled = true; 51 | //bbox_drawer.enable(); 52 | binput.enable(); 53 | timer.start(); 54 | } 55 | 56 | that.disable = function() { 57 | enabled = false; 58 | bbox_drawer.disable(); 59 | binput.disable(); 60 | timer.stop(); 61 | } 62 | 63 | that.disable(); 64 | 65 | return that; 66 | } 67 | 68 | return vg; 69 | 70 | }(VG || {})); 71 | -------------------------------------------------------------------------------- /best_of_both_worlds/verify_box_task.js: -------------------------------------------------------------------------------- 1 | var VG = (function(vg) { 2 | vg.VerifyBoxTask = function(container_div,task_input) { 3 | var that = (this === vg ? {} : this); 4 | var enabled = false; 5 | 6 | var image_url = task_input.image_url; 7 | var box = task_input.box; 8 | 9 | var task_name = "Is this a good box around a"; 10 | 11 | var ti_options = {object_name: task_input.object_name, 12 | instructions_url: "verify_box_instructions.html" 13 | } 14 | 15 | var ui_div = VG.TaskInstructions(container_div,task_name,ti_options).GetInputDiv(); 16 | 17 | var drawer_div = $('
').appendTo(ui_div); 18 | 19 | binput_options = { 20 | pos_button_name: 'Yes, it is a good box', 21 | neg_button_name: 'No, it is not a good box', 22 | gt: task_input.gt 23 | } 24 | 25 | 26 | VIEWPORT_HEIGHT = 500; 27 | 28 | var max_height = VIEWPORT_HEIGHT; 29 | max_height -= $('#task-instr-div').height(); 30 | max_height -= $('#c-buttons-div').height(); 31 | var images_div = $('#c-imgs-div'); 32 | var bbox_drawer_options = { 33 | max_height: max_height, 34 | max_width: images_div.width(), 35 | static_box_color: 'blue' 36 | }; 37 | var bbox_drawer = new VG.BBoxDrawer(drawer_div,image_url,null,bbox_drawer_options); 38 | bbox_drawer.addStaticBox(box); 39 | 40 | var binput = new VG.BinaryInput(ui_div,binput_options); 41 | 42 | 43 | var timer = new VG.Timer(); 44 | 45 | that.GetAnswerIfValid = function () { 46 | return {'answer': binput.GetAnswer(), 47 | 'time':timer.total(), 48 | 'eval':binput.EvalAnswer()}; 49 | } 50 | 51 | that.enable = function() { 52 | enabled = true; 53 | //bbox_drawer.enable(); 54 | binput.enable(); 55 | timer.start(); 56 | } 57 | 58 | that.disable = function() { 59 | enabled = false; 60 | bbox_drawer.disable(); 61 | binput.disable(); 62 | timer.stop(); 63 | } 64 | 65 | that.disable(); 66 | 67 | return that; 68 | } 69 | 70 | return vg; 71 | 72 | }(VG || {})); 73 | -------------------------------------------------------------------------------- /best_of_both_worlds/verify_cover_task.js: -------------------------------------------------------------------------------- 1 | var VG = (function(vg) { 2 | vg.VerifyCoverTask = function(container_div,task_input) { 3 | var that = (this === vg ? {} : this); 4 | var enabled = false; 5 | 6 | var image_url = task_input.image_url; 7 | var boxes = task_input.boxes; 8 | 9 | var task_name = "Is there a good box around EVERY instance of:"; 10 | 11 | var ti_options = {object_name: task_input.object_name, 12 | instructions_url: "verify_cover_instructions.html" 13 | } 14 | var ui_div = VG.TaskInstructions(container_div,task_name,ti_options).GetInputDiv(); 15 | 16 | var drawer_div = $('
').appendTo(ui_div); 17 | 18 | binput_options = { 19 | pos_button_name: 'Yes, every instance is covered', 20 | neg_button_name: 'No, not every instance is covered', 21 | gt:task_input.gt 22 | } 23 | var binput = new VG.BinaryInput(ui_div,binput_options); 24 | 25 | VIEWPORT_HEIGHT = 500; 26 | 27 | var max_height = VIEWPORT_HEIGHT; 28 | max_height -= $('#task-instr-div').height(); 29 | max_height -= $('#c-buttons-div').height(); 30 | var images_div = $('#c-imgs-div'); 31 | var bbox_drawer_options = { 32 | max_height: max_height, 33 | max_width: images_div.width(), 34 | static_box_color: 'blue' 35 | }; 36 | var bbox_drawer = new VG.BBoxDrawer(drawer_div,image_url,null,bbox_drawer_options); 37 | bbox_drawer.addStaticBoxes(boxes); 38 | 39 | var timer = new VG.Timer(); 40 | 41 | that.enable = function() { 42 | enabled = true; 43 | //bbox_drawer.enable(); 44 | binput.enable(); 45 | timer.start(); 46 | } 47 | 48 | that.disable = function() { 49 | enabled = false; 50 | bbox_drawer.disable(); 51 | binput.disable(); 52 | timer.stop(); 53 | } 54 | 55 | that.GetAnswerIfValid = function () { 56 | return {'answer': binput.GetAnswer(), 57 | 'time':timer.total(), 58 | 'eval':binput.EvalAnswer()}; 59 | } 60 | 61 | that.disable(); 62 | 63 | return that; 64 | } 65 | 66 | return vg; 67 | 68 | }(VG || {})); 69 | -------------------------------------------------------------------------------- /best_of_both_worlds/write_name_task.js: -------------------------------------------------------------------------------- 1 | var VG = (function(vg) { 2 | vg.WriteNameTask = function(container_div,task_input) { 3 | var that = (this === vg ? {} : this); 4 | var enabled = false; 5 | 6 | var image_url = task_input.image_url; 7 | var box = task_input.box; 8 | 9 | var task_name = "Name the object in the blue box (only if the box is good!):"; 10 | 11 | var ti_options = {instructions_url: "write_name_instructions.html" 12 | } 13 | 14 | var ui_div = VG.TaskInstructions(container_div,task_name,ti_options).GetInputDiv(); 15 | 16 | tinput_opts = {include_button : true, 17 | button_text: 'Click here if not a good box', 18 | button_text_clicked:'Not a good box (click to undo)', 19 | gt: task_input.gt, 20 | autocomplete_options: task_input.autocomplete_options 21 | }; 22 | var tinput = new VG.TextInput(ui_div,tinput_opts); 23 | 24 | var drawer_div = $('
').appendTo(ui_div); 25 | 26 | VIEWPORT_HEIGHT = 500; 27 | 28 | var max_height = VIEWPORT_HEIGHT; 29 | max_height -= $('#task-instr-div').height(); 30 | max_height -= $('#c-buttons-div').height(); 31 | var images_div = $('#c-imgs-div'); 32 | var bbox_drawer_options = { 33 | max_height: max_height, 34 | max_width: images_div.width(), 35 | static_box_color: 'blue' 36 | }; 37 | var bbox_drawer = new VG.BBoxDrawer(drawer_div,image_url,null,bbox_drawer_options); 38 | bbox_drawer.addStaticBox(box); 39 | bbox_drawer.disable(); 40 | 41 | var timer = new VG.Timer(); 42 | 43 | that.enable = function() { 44 | enabled = true; 45 | tinput.enable(); 46 | timer.start(); 47 | } 48 | 49 | that.disable = function() { 50 | enabled = false; 51 | tinput.disable(); 52 | timer.stop(); 53 | } 54 | 55 | that.GetAnswerIfValid = function () { 56 | return {'answer': tinput.GetAnswer(), 57 | 'time':timer.total(), 58 | 'eval':tinput.EvalAnswer()}; 59 | } 60 | 61 | that.disable(); 62 | 63 | return that; 64 | } 65 | 66 | return vg; 67 | 68 | }(VG || {})); 69 | -------------------------------------------------------------------------------- /best_of_both_worlds/sample_input.js: -------------------------------------------------------------------------------- 1 | var VG = (function(vg) { 2 | 3 | vg.SampleInput = function() { 4 | var that = (this === vg ? {} : this); 5 | 6 | that.get = function(index) { 7 | // ignores 'index' currently, but you can set it up to provide different inputs 8 | // depending on the index, for easy debugging 9 | return {"questions": [{"img_id": "ILSVRC2013_val_00002683","gt": 1,"class": 60,"object_name": "dragonfly","image_url": "http://www.image-net.org/image/ilsvrc2013/ILSVRC2013_DET_val/ILSVRC2013_val_00002683.JPEG","task": "vi"},{"img_id": "ILSVRC2012_val_00008738","gt": 1,"class": 171,"box": {"x": 309,"y": 108,"w": 157,"h": 104},"object_name": "strawberry","image_url": "http://www.image-net.org/image/ilsvrc2013/ILSVRC2013_DET_val/ILSVRC2012_val_00008738.JPEG","task": "vb"},{"img_id": "ILSVRC2012_val_00030313","gt": {"x": 81,"y": 67,"w": 201,"h": 280},"class": 113,"boxes": {"x": 110,"y": 30,"w": 138,"h": 77},"object_name": "monkey","image_url": "http://www.image-net.org/image/ilsvrc2013/ILSVRC2013_DET_val/ILSVRC2012_val_00030313.JPEG","task": "db"},{"img_id": "ILSVRC2012_val_00028723","gt": -1,"class": 71,"boxes": {"x": 1,"y": 1,"w": 375,"h": 178},"object_name": "french horn","image_url": "http://www.image-net.org/image/ilsvrc2013/ILSVRC2013_DET_val/ILSVRC2012_val_00028723.JPEG","task": "vc"},{"img_id": "ILSVRC2012_val_00003154","box": {"x": 258,"y": 247,"w": 104,"h": 174},"gt": -1,"image_url": "http://www.image-net.org/image/ilsvrc2013/ILSVRC2013_DET_val/ILSVRC2012_val_00003154.JPEG","task": "vo"},{"img_id": "ILSVRC2013_val_00003000","box": {"x": 438,"y": 260,"w": 62,"h": 79},"gt": -1,"image_url": "http://www.image-net.org/image/ilsvrc2013/ILSVRC2013_DET_val/ILSVRC2013_val_00003000.JPEG","task": "wn"},{"img_id": "ILSVRC2012_val_00018661","class": 77,"curr_classes": 37,"object_name": "golfcart","curr_object_names": "car","image_url": "http://www.image-net.org/image/ilsvrc2013/ILSVRC2013_DET_val/ILSVRC2012_val_00018661.JPEG","task": "wt","meta": {"gt_img_ids": 8702,"gt_obj_labels": [37,77],"gt_obj_bboxes": [[0,129],[144,134],[49,342],[203,352]],"w": 500,"h": 375,"gt_img_name": "ILSVRC2012_val_00018661","amt_gt": 1}}],"accuracy": 0.99}; 10 | } 11 | 12 | return that; 13 | } 14 | 15 | return vg; 16 | 17 | }(VG || {})); 18 | -------------------------------------------------------------------------------- /best_of_both_worlds/write_class_task.js: -------------------------------------------------------------------------------- 1 | var VG = (function(vg) { 2 | vg.WriteClassTask = function(container_div,task_input) { 3 | var that = (this === vg ? {} : this); 4 | var enabled = false; 5 | 6 | var image_url = task_input.image_url; 7 | var box = task_input.box; 8 | 9 | var s= ''; 10 | if (task_input.curr_object_names) { 11 | if (typeof task_input.curr_object_names === 'string') { 12 | s = "Current object: " + task_input.curr_object_names; 13 | } else if (task_input.curr_object_names.length > 0) { 14 | s = "Current objects: " 15 | for (var i=0;i 0) 17 | s += '; '; 18 | s += task_input.curr_object_names[i]; 19 | } 20 | } 21 | } 22 | if (s.length > 0) { 23 | var task_name = "Name another object in the image:"; 24 | var bt = "Click here if no other objects"; 25 | var btc = "No other objects (click to undo)"; 26 | } else { 27 | var task_name = "Name an object in the image:"; 28 | var bt = "Click here if no objects"; 29 | var btc = "No objects (click to undo)"; 30 | } 31 | 32 | var ti_options = {instructions_url: "write_class_instructions.html" 33 | } 34 | 35 | var ui_div = VG.TaskInstructions(container_div,task_name,ti_options).GetInputDiv(); 36 | 37 | 38 | var obj_div = $('
') 39 | .addClass('text-center') 40 | .text(s) 41 | .appendTo(ui_div); 42 | 43 | tinput_opts = {include_button : true, 44 | button_text: bt, 45 | button_text_clicked:btc, 46 | gt: task_input.gt, 47 | autocomplete_options: task_input.autocomplete_options, 48 | prohibited_text: task_input.curr_object_names 49 | }; 50 | var tinput = new VG.TextInput(ui_div,tinput_opts); 51 | 52 | 53 | var img_div = $('').attr('src',image_url).appendTo(ui_div); 54 | 55 | var timer = new VG.Timer(); 56 | 57 | that.enable = function() { 58 | enabled = true; 59 | tinput.enable(); 60 | timer.start(); 61 | } 62 | 63 | that.disable = function() { 64 | enabled = false; 65 | tinput.disable(); 66 | timer.stop(); 67 | } 68 | 69 | that.GetAnswerIfValid = function () { 70 | return {'answer': tinput.GetAnswer(), 71 | 'time':timer.total(), 72 | 'eval':tinput.EvalAnswer()}; 73 | } 74 | 75 | that.disable(); 76 | 77 | return that; 78 | } 79 | 80 | return vg; 81 | 82 | }(VG || {})); 83 | -------------------------------------------------------------------------------- /best_of_both_worlds/binary_input.js: -------------------------------------------------------------------------------- 1 | var VG = (function(vg) { 2 | var DEFAULT_OPTIONS = { 3 | pos_button_name: 'Yes', 4 | neg_button_name: 'No', 5 | gt: null 6 | } 7 | 8 | vg.BinaryInput = function(container_div,options) { 9 | var that = (this === vg ? {} : this); 10 | 11 | options = vg.merge_options(options,DEFAULT_OPTIONS); 12 | var answer = 0; 13 | 14 | var enabled = false; 15 | 16 | var button_div = $('
').appendTo(container_div); 17 | 18 | var button_yes=$(' 136 |
137 | 138 | 139 | 142 |
143 | 144 | 145 | 146 |
147 |
148 | 149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 | 339 | 340 | 341 | -------------------------------------------------------------------------------- /whats_the_point/point-drawer-once.js: -------------------------------------------------------------------------------- 1 | var VG = (function(vg, $) { 2 | 3 | var DEFAULT_OPTIONS = { 4 | //unused for now 5 | obj_singular: "", 6 | gt: null, 7 | 8 | handle_opacity: 0.7, 9 | conflict_radius: 10, 10 | pointer_radius: 5, // unused currently 11 | click_radius: 10, 12 | image_opacity: 0.9, 13 | max_height: 300, 14 | max_width: 500, 15 | 16 | callback: function() {}, 17 | }; 18 | 19 | /* 20 | var STATIC_BOX_COLOR = '#f00'; 21 | var BBOX_COLOR = '#00f'; 22 | var BBOX_LINE_WIDTH = 2.0; 23 | 24 | var CLICK_RADIUS = 15; 25 | var HANDLE_OPACITY = 0.2; 26 | 27 | var OBJECT_SMALL_RADIUS = 5; 28 | var OBJECT_BIG_RADIUS = 10; 29 | */ 30 | 31 | var TEXT_FONT_SIZE = 20; 32 | var TEXT_FONT = TEXT_FONT_SIZE + 'px sans-serif'; 33 | var TEXT_BOX_PADDING = 4; 34 | 35 | vg.PointDrawerOnce = function(div, image_url, canvas_width, options) { 36 | var that = (this === vg ? {} : this); 37 | 38 | options = vg.merge_options(options, DEFAULT_OPTIONS); 39 | 40 | var scale = null; 41 | var canvas = null; 42 | var canvas_pos = null; 43 | var ctx = null; 44 | 45 | // Most recent positions of the mouse and of a click 46 | var click_pos = null; 47 | var mouse_pos = null; 48 | 49 | // Object with properties x, y 50 | var clicks = []; 51 | 52 | // if mouse gets too close to any point, save that fact 53 | var conflict_click_idx = null; 54 | 55 | var disabled = true; 56 | 57 | var counterdiv = null; 58 | 59 | var buttondiv = null; 60 | var binput = null; 61 | var binput_on = false; 62 | 63 | var timer = new VG.Timer(); 64 | 65 | var button_text = 'Click here to confirm there is no ' + options.obj_singular; 66 | var button_text_clicked = 'There is no ' + options.obj_singular + ' (click again to undo)'; 67 | 68 | var timer = new VG.Timer(); 69 | 70 | // object with properties x, y, add, time 71 | var history = []; 72 | 73 | // todo: set up ground truth evaluation with segmentations 74 | // and with number of instances that should be clicked 75 | 76 | var img = new Image(); 77 | img.onload = setup; 78 | img.src = image_url; 79 | 80 | function GetClicks() { 81 | var clicks_img = []; 82 | for (var i=0; i= bx1 && x <= bx2 && y >= by1 && y <= by2) { 117 | bOK = true; // at least one was clicked correctly 118 | //break; 119 | } 120 | //} 121 | } else { 122 | for (var i=0; i < options.gt.bbox.length; i++) { 123 | var bx1 = options.gt.bbox[i].x; 124 | var by1 = options.gt.bbox[i].y; 125 | var bx2 = bx1 + options.gt.bbox[i].w; 126 | var by2 = by1 + options.gt.bbox[i].h; 127 | 128 | j = 0; 129 | //for (var j=0; j < clicks_img.length;j++) { 130 | var x = clicks_img[j].x; 131 | var y = clicks_img[j].y; 132 | if (x >= bx1 && x <= bx2 && y >= by1 && y <= by2) { 133 | bOK = true; // at least one was clicked correctly 134 | break; 135 | } 136 | //} 137 | //if (bOK) { 138 | // break; 139 | //} 140 | } 141 | } 142 | } 143 | 144 | if (options.gt.num_min >= 0 && options.gt.num_min < 10) { 145 | bChecked = true; 146 | if (clicks.length < options.gt.num_min) { 147 | bOK = false; 148 | } 149 | } 150 | 151 | if (options.gt.num_max <= 1000000) { 152 | bChecked = true; 153 | if (clicks.length > options.gt.num_max) { 154 | bOK = false; 155 | } 156 | } 157 | } 158 | 159 | if (bChecked) { 160 | if (bOK) 161 | return 'good'; 162 | else 163 | return 'bad'; 164 | } else { 165 | return 'neutral'; 166 | } 167 | } 168 | 169 | function choose_scale(img) { 170 | if (_.isNumber(options.max_width) && _.isNumber(options.max_height)) { 171 | var scale_h = img.width / options.max_width; 172 | var scale_v = img.height / options.max_height; 173 | return Math.max(scale_h, scale_v); 174 | } else { 175 | return img.width / canvas_width; 176 | } 177 | } 178 | 179 | function setup() { 180 | 181 | // scale = img.width / canvas_width; 182 | scale = choose_scale(img); 183 | canvas_width = img.width / scale; 184 | var canvas_height = img.height / scale; 185 | canvas = $('') 186 | .attr({'width': canvas_width, 187 | 'height': canvas_height}) 188 | .css({'cursor': 'pointer'}) 189 | .appendTo(div); 190 | 191 | canvas_pos = {'x': canvas.offset().left, 'y': canvas.offset().top}; 192 | ctx = canvas[0].getContext('2d'); 193 | canvas.mousemove(mousemove); 194 | canvas.mousedown(mousedown); 195 | canvas.mouseup(mouseup); 196 | canvas.mouseout(mouseup); 197 | 198 | draw(); 199 | options.callback(); 200 | 201 | if (disabled) 202 | setCursor('pointer'); 203 | 204 | counterdiv = $('
').appendTo(div); 205 | updateCounter(); 206 | 207 | buttondiv = $('
').appendTo(div); 208 | 209 | binput=$(' 138 |
139 | 140 | 141 | 144 |
145 | 146 | 147 | 148 |
149 |
150 | 151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 | 360 | 361 | 362 | -------------------------------------------------------------------------------- /whats_the_point/bbox-drawer.js: -------------------------------------------------------------------------------- 1 | var VG = (function(vg, $) { 2 | 3 | var DEFAULT_OPTIONS = { 4 | //static_box_color: '#f00', 5 | static_box_color: 'red', 6 | bbox_color: '#00f', 7 | bbox_line_width: 5.0, 8 | click_radius: 15, 9 | handle_opacity: 0.2, 10 | dot_small_radius: 5, 11 | dot_big_radius: 10, 12 | image_opacity: 0.9, 13 | max_height: 300, 14 | max_width: 500, 15 | include_button: false, 16 | button_text: 'Click here if no box can be drawn', 17 | button_text_clicked: 'No box can be drawn (click again to undo)', 18 | callback: function() {}, 19 | }; 20 | 21 | /* 22 | var STATIC_BOX_COLOR = '#f00'; 23 | var BBOX_COLOR = '#00f'; 24 | var BBOX_LINE_WIDTH = 2.0; 25 | 26 | var CLICK_RADIUS = 15; 27 | var HANDLE_OPACITY = 0.2; 28 | 29 | var OBJECT_SMALL_RADIUS = 5; 30 | var OBJECT_BIG_RADIUS = 10; 31 | */ 32 | 33 | var TEXT_FONT_SIZE = 20; 34 | var TEXT_FONT = TEXT_FONT_SIZE + 'px sans-serif'; 35 | var TEXT_BOX_PADDING = 4; 36 | 37 | vg.BBoxDrawer = function(div, image_url, canvas_width, options) { 38 | var that = (this === vg ? {} : this); 39 | 40 | options = vg.merge_options(options, DEFAULT_OPTIONS); 41 | 42 | var scale = null; 43 | var canvas = null; 44 | var canvas_pos = null; 45 | var ctx = null; 46 | 47 | // Most recent positions of the mouse and of a click 48 | var click_pos = null; 49 | var mouse_pos = null; 50 | 51 | // Whether the box has been been finalized after the initial drag 52 | var bbox_drawn = false; 53 | 54 | // Object with properties x, y, w, h 55 | var bbox = null; 56 | var static_boxes = []; 57 | 58 | var object_pos = null; 59 | var object_name = null; 60 | 61 | var resize_direction = null; 62 | var old_bbox = null; 63 | 64 | var disabled = true; 65 | 66 | var binput = null; 67 | var binput_on = false; 68 | 69 | var p_thr_gt = 10; 70 | var iou_thr_gt = 0.6; 71 | var p_thr_box = 10; 72 | var iou_thr_box = 0.8; 73 | 74 | var cursors = { 75 | 'UL': 'nw-resize', 76 | 'UR': 'ne-resize', 77 | 'BL': 'sw-resize', 78 | 'BR': 'se-resize', 79 | 'U': 'n-resize', 80 | 'R': 'e-resize', 81 | 'L': 'w-resize', 82 | 'B': 's-resize', 83 | }; 84 | 85 | var img = new Image(); 86 | img.onload = setup; 87 | img.src = image_url; 88 | 89 | that.getBoxPosition = function() { 90 | if (bbox) { 91 | // Convert to image coordinates 92 | return { 93 | 'x': toImageCoords(bbox.x), 94 | 'y': toImageCoords(bbox.y), 95 | 'w': toImageCoords(bbox.w), 96 | 'h': toImageCoords(bbox.h) 97 | }; 98 | } 99 | return null; 100 | } 101 | 102 | that.GetAnswer = function() { 103 | if (binput && binput_on) 104 | return -1; 105 | else if (bbox) 106 | return that.getBoxPosition(); 107 | else 108 | return null; 109 | } 110 | 111 | that.EvalAnswer = function() { 112 | if (binput && binput_on) { // thinks there's no box 113 | if (options.gt == null) 114 | return 'neutral'; // no idea if it's ok 115 | else if (options.gt == -1) 116 | return 'good'; // verified 117 | else { 118 | return 'bad'; // gt disagrees 119 | } 120 | } else if (bbox && isValidBox()) { // drew a reasonable box 121 | box_ans = that.getBoxPosition(); 122 | if (options.gt == null) { // nothing to check 123 | return 'neutral'; 124 | } else if (options.gt == -1) { // wrong 125 | return 'bad'; 126 | } else { 127 | if (tooclose_any(box_ans,options.gt,p_thr_gt,iou_thr_gt)) { // close enough 128 | return 'good'; 129 | } else { 130 | return 'bad'; 131 | } 132 | } 133 | } else { 134 | return 'incomplete'; 135 | } 136 | } 137 | 138 | that.setObject = function(x, y, name) { 139 | if (scale) { 140 | object_pos = {'x': toCanvasCoords(x), 'y': toCanvasCoords(y)}; 141 | } else { 142 | object_pos = {'x': x, 'y': y}; 143 | } 144 | object_name = name; 145 | } 146 | 147 | that.addStaticBox = function(box) { 148 | sb = $.extend({}, box); 149 | if (scale) { 150 | sb.x = toCanvasCoords(box.x); 151 | sb.y = toCanvasCoords(box.y); 152 | sb.w = toCanvasCoords(box.w); 153 | sb.h = toCanvasCoords(box.h); 154 | } 155 | static_boxes.push(sb); 156 | draw(); 157 | } 158 | that.addStaticBoxes = function(boxes) { 159 | if (typeof(boxes.x) === 'undefined') { 160 | for (var i=0; i < boxes.length; i++) { 161 | that.addStaticBox(boxes[i]); 162 | } 163 | } else { 164 | that.addStaticBox(boxes); 165 | } 166 | } 167 | 168 | function choose_scale(img) { 169 | if (_.isNumber(options.max_width) && _.isNumber(options.max_height)) { 170 | var scale_h = img.width / options.max_width; 171 | var scale_v = img.height / options.max_height; 172 | return Math.max(scale_h, scale_v); 173 | } else { 174 | return img.width / canvas_width; 175 | } 176 | } 177 | 178 | function setup() { 179 | // scale = img.width / canvas_width; 180 | scale = choose_scale(img); 181 | canvas_width = img.width / scale; 182 | var canvas_height = img.height / scale; 183 | canvas = $('') 184 | .attr({'width': canvas_width, 185 | 'height': canvas_height}) 186 | .css({'cursor': 'crosshair'}) 187 | .appendTo(div); 188 | 189 | canvas_pos = {'x': canvas.offset().left, 'y': canvas.offset().top}; 190 | ctx = canvas[0].getContext('2d'); 191 | canvas.mousemove(mousemove); 192 | canvas.mousedown(mousedown); 193 | canvas.mouseup(mouseup); 194 | canvas.mouseout(mouseup); 195 | 196 | if (object_pos) { 197 | object_pos.x = toCanvasCoords(object_pos.x); 198 | object_pos.y = toCanvasCoords(object_pos.y); 199 | } 200 | 201 | // Convert the static box from image coordinates to canvas coordinates 202 | var props = ['x', 'y', 'w', 'h']; 203 | for (var k=0; k < static_boxes.length; k++) { 204 | for (var i = 0; i < props.length; i++) { 205 | static_boxes[k][props[i]] = toCanvasCoords(static_boxes[k][props[i]]); 206 | } 207 | } 208 | 209 | draw(); 210 | options.callback(); 211 | 212 | if (disabled) 213 | setCursor('pointer'); 214 | 215 | if (options.include_button) { 216 | var bdiv = $('
').appendTo(div); 217 | 218 | binput=$('