Web platform for sharing free image data for ML and research

Homepage: https://datasets.roundabout-host.com

By using this site, you agree to have cookies stored on your device, strictly for functional purposes, such as storing your session and preferences.

Dismiss

 small-annotation-display.html

View raw Download
text/plain • 1.69 kiB
ASCII text
        
            
1
{% macro annotation_display(resource) %}
2
<div class="annotation-zone">
3
<img src="/raw/picture/{{ resource.id }}" alt="{{ resource.title }}">
4
{% for region in resource.regions %}
5
{% if region.json.type == "bbox" %}
6
<svg class="shape-container" viewBox="0 0 1 1" preserveAspectRatio="none">
7
<rect x="{{ region.json.shape.x }}"
8
y="{{ region.json.shape.y }}"
9
width="{{ region.json.shape.w }}"
10
height="{{ region.json.shape.h }}"
11
fill="none" class="shape-bbox shape"
12
></rect>
13
</svg>
14
{% elif region.json.type == "polygon" %}
15
<svg class="shape-container" viewBox="0 0 1 1" preserveAspectRatio="none">
16
<polygon points="{% for point in region.json.shape %}{{ point.x }},{{ point.y }} {% endfor %}" fill="none" class="shape-polygon shape"></polygon>
17
</svg>
18
{% elif region.json.type == "polyline" %}
19
<svg class="shape-container" viewBox="0 0 1 1" preserveAspectRatio="none">
20
<polyline points="{% for point in region.json.shape %}{{ point.x }},{{ point.y }} {% endfor %}" fill="none" class="shape-polyline shape"></polyline>
21
</svg>
22
{% elif region.json.type == "point" %}
23
<svg class="shape-container" viewBox="0 0 1 1" preserveAspectRatio="none">
24
<circle cx="{{ region.json.shape.x }}" cy="{{ region.json.shape.y }}" r="0" fill="none" class="shape-point shape"></circle>
25
</svg>
26
{% endif %}
27
{% endfor %}
28
</div>
29
{% endmacro %}