def index(): label_classes_json = [{'name': cls.name, 'human_name': cls.human_name, 'colour': cls.colour} for cls in label_classes] return render_template('labeller_page.jinja2', tool_js_urls=labelling_tool.js_file_urls('/static/labelling_tool/'), label_classes=json.dumps(label_classes_json), image_descriptors=json.dumps(image_descriptors), initial_image_index=0, config=json.dumps(config))
def index(): label_classes_json = [cls.to_json() for cls in label_classes] return render_template('labeller_page.jinja2', tool_js_urls=labelling_tool.js_file_urls( '/static/labelling_tool/'), label_classes=json.dumps(label_classes_json), image_descriptors=json.dumps(image_descriptors), initial_image_index=0, config=json.dumps(config), use_websockets=socketio is not None)
def labelling_tool_scripts(): script_urls = lt.js_file_urls('/static/labelling_tool/') script_tags = ''.join( ['<script src="{}"></script>\n'.format(url) for url in script_urls]) return format_html(script_tags)