This repository was archived by the owner on Jul 14, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 49
Expand file tree
/
Copy pathdemo.html
More file actions
45 lines (42 loc) · 1.5 KB
/
demo.html
File metadata and controls
45 lines (42 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<html>
<head>
<title>Bounding box annotator demo</title>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.js"></script>
<script src="bbox_annotator.js"></script>
</head>
<body>
<h1>Bounding box annotator demo</h1>
<div id="bbox_annotator" style="display:inline-block"></div>
<div style="display:inline-block;vertical-align:top;">
<div>
<textarea id="annotation_data" name="annotation" rows="30" cols="50" style="font-family:monospace;" readonly></textarea>
</div>
<div>
<input id="reset_button" type="reset" />
</div>
</div>
<script type="text/javascript">
$(document).ready(function() {
// Initialize the bounding-box annotator.
var annotator = new BBoxAnnotator({
url: "example.jpg",
input_method: 'fixed', // Can be one of ['text', 'select', 'fixed']
labels: "object",
guide: true,
onchange: function(entries) {
// Input the text area on change. Use "hidden" input tag unless debugging.
// <input id="annotation_data" name="annotation_data" type="hidden" />
// $("#annotation_data").val(JSON.stringify(entries))
$("#annotation_data").text(JSON.stringify(entries, null, " "));
}
});
// Initialize the reset button.
$("#reset_button").click(function(e) {
annotator.clear_all();
})
});
</script>
</body>
</html>