picture-annotation.html
HTML document, ASCII text
1{% extends "default.html" %} 2 3{% block nav_title %}{{ resource.title }}{% endblock %} 4{% block title %}Annotating picture {{ resource.title }} | {{ site_name }}{% endblock %} 5{% set back_url = "/picture/" + resource.id|string %} 6{% set fixed_content_area = true %} 7 8{% block content %} 9<style> 10py-script { 11display: none; 12} 13/* Full PyScript style is too much, but we still need to hide the Python code */ 14</style> 15<script type="module" src="https://pyscript.net/releases/2024.8.2/core.js"></script> 16 17<x-frame id="annotation-main-area"> 18<x-hbox id="annotation-controls"> 19<x-buttonbox id="shape-selector"> 20<button class="button-flat" title="selection" id="select"> 21<iconify-icon icon="mdi:cursor-default"></iconify-icon> 22</button> 23<button class="button-flat" title="rectangle" id="shape-bbox"> 24<iconify-icon icon="mdi:square"></iconify-icon> 25</button> 26<button class="button-flat" title="polygon" id="shape-polygon"> 27<iconify-icon icon="mdi:pentagon"></iconify-icon> 28</button> 29<button class="button-flat" title="polyline" id="shape-polyline"> 30<iconify-icon icon="mdi:graph-line-variant"></iconify-icon> 31</button> 32<button class="button-flat" title="point" id="shape-point"> 33<iconify-icon icon="mdi:crosshairs-gps"></iconify-icon> 34</button> 35<x-hbox id="annotation-zoom-controls"> 36<span id="zoom-indicator">1.000x</span> 37<button class="button-flat" title="zoom out" id="zoom-out"> 38<iconify-icon icon="mdi:magnify-minus"></iconify-icon> 39</button> 40<input type="range" id="zoom-slider" min="-4" max="6" step="0.25" value="0" aria-label="Zoom"> 41<button class="button-flat" title="zoom in" id="zoom-in"> 42<iconify-icon icon="mdi:magnify-plus"></iconify-icon> 43</button> 44</x-hbox> 45</x-buttonbox> 46<x-buttonbox style="display: none;" id="shape-options"> 47<button class="button-flat" title="cancel" id="annotation-cancel"> 48<iconify-icon icon="mdi:close"></iconify-icon> 49</button> 50<button class="button-flat" title="apply" id="annotation-confirm"> 51<iconify-icon icon="mdi:check"></iconify-icon> 52</button> 53<button class="button-flat" title="remove last point" id="annotation-backspace"> 54<iconify-icon icon="mdi:backspace"></iconify-icon> 55</button> 56<button class="button-flat" title="delete shape" id="annotation-delete"> 57<iconify-icon icon="mdi:delete"></iconify-icon> 58</button> 59<button class="button-flat" title="select previous shape" id="annotation-previous"> 60<iconify-icon icon="mdi:chevron-left"></iconify-icon> 61</button> 62<button class="button-flat" title="select next shape" id="annotation-next"> 63<iconify-icon icon="mdi:chevron-right"></iconify-icon> 64</button> 65<div class="flexible-space"></div> 66<button id="annotation-save"> 67Save 68</button> 69</x-buttonbox> 70</x-hbox> 71<div id="annotation-zoom-container"> 72<div id="annotation-zone"> 73<x-vbox id="object-types" style="--gap-box: 0.25rem; --padding-box: 1rem;"> 74<input type="text" id="filter-object-types" placeholder="Search" aria-label="Search object types"> 75<x-vbox id="object-types-content"></x-vbox> 76</x-vbox> 77<img id="annotation-image" src="/raw/picture/{{ resource.id }}" alt=""> 78<div id="annotation-ruler-vertical" class="annotation-ruler"></div> 79<div id="annotation-ruler-horizontal" class="annotation-ruler"></div> 80<div id="annotation-ruler-vertical-secondary" class="annotation-ruler"></div> 81<div id="annotation-ruler-horizontal-secondary" class="annotation-ruler"></div> 82</div> 83</div> 84<p id="annotation-helper-message">Please wait for Python to load...</p> 85</x-frame> 86<input type="hidden" id="resource-id" name="resource-id" value="{{ resource.id }}"> 87<script type="mpy" src="/static/picture-annotation.py"></script> 88{% endblock %} 89