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