From 65c82e9e8926fb05a0f25b8c445188e5eab644f2 Mon Sep 17 00:00:00 2001 From: Csanad Tabajdi <tabajdi.csanad@proton.me> Date: Wed, 22 Jan 2025 14:31:22 +0100 Subject: [PATCH] Update terminology for AI scoring and enhance settings defaults. Fix: missing auto annotations --- src/app.html | 8 ++++---- src/js/servercom.js | 26 ++++++++++++++++---------- src/js/settings.js | 4 ++-- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/src/app.html b/src/app.html index 72b0614..e5db8fc 100644 --- a/src/app.html +++ b/src/app.html @@ -729,7 +729,7 @@ <div class="form-check form-switch"> <input class="form-check-input" type="checkbox" role="switch" id="settings_showScore" onchange="settings.showScore()" /> - <label class="form-check-label" for="settings_showScore">Show score (AI) in annotation + <label class="form-check-label" for="settings_showScore">Show confidence score in annotation list <small>(if the region is AI processed)</small> </label> </div> @@ -750,16 +750,16 @@ <div class="row mb-3 p-3"> <div class="card"> <div class="card-body"> - <h5 class="card-title">Scoring (AI)</h5> + <h5 class="card-title">Confidence Score (AI)</h5> <div class="col-auto"> - <label for="settings_scoring" class="col-form-label">Score threshold</label> + <label for="settings_scoring" class="col-form-label">Confidence score threshold</label> <input type="text" class="form-control" id="settings_scoring" placeholder="E.g. 0.1" /> </div> <div class="col-auto mt-2"> <div class="form-check form-switch"> <input class="form-check-input" type="checkbox" role="switch" id="settings_showScoreColor" onchange="settings.showScoreColor()" /> - <label class="form-check-label" for="settings_showScoreColor">Show score color in + <label class="form-check-label" for="settings_showScoreColor">Show confidence score color in annotation list <small>(if the region is AI processed)</small> </label> </div> diff --git a/src/js/servercom.js b/src/js/servercom.js index a7ba422..c28173e 100644 --- a/src/js/servercom.js +++ b/src/js/servercom.js @@ -73,8 +73,6 @@ Annotate.prototype.annotate_single_img = async function () { this.setProgressBar(this.progressNum); let image_index = _via_image_index; let img_id = _via_image_id_list[image_index]; - const imageElement = $("#bim" + image_index)[0]; - const imageBlob = await this.getImageBlobFromElement(imageElement); await this.isAnnotated(img_id).then((res) => { }); switch (this.reAnnotateCommand) { @@ -91,6 +89,8 @@ Annotate.prototype.annotate_single_img = async function () { default: break; } + const imageElement = $("#bim" + image_index)[0]; + const imageBlob = await this.getImageBlobFromElement(imageElement); await this.sendImage( imageBlob, _via_img_metadata[_via_image_id_list[image_index]].filename @@ -332,9 +332,12 @@ Annotate.prototype.sendImage = async function (img_blob, img_filename) { } zoom.resetZoom(); for (let file in response) { - let img_id = - _via_image_id_list[_via_image_filename_list.indexOf(file)]; - AutoAnnotator.addAnnotations(img_id, response[file]); + if(!file){ + continue; + } + let img_id = + _via_image_id_list[_via_image_filename_list.indexOf(file)]; + AutoAnnotator.addAnnotations(img_id, response[file]); } AutoAnnotator.setAllItemSuccess(); Message.show({ @@ -429,11 +432,14 @@ Annotate.prototype.sendImageAll = async function () { } zoom.resetZoom(); for (let file in response) { - let img_id = _via_image_id_list[_via_image_filename_list.indexOf(file)]; - if (reannotate) { - _via_img_metadata[img_id].regions = []; - } - AutoAnnotator.addAnnotations(img_id, response[file]); + if(!file){ + continue; + } + let img_id = _via_image_id_list[_via_image_filename_list.indexOf(file)]; + if (reannotate) { + _via_img_metadata[img_id].regions = []; + } + AutoAnnotator.addAnnotations(img_id, response[file]); } AutoAnnotator.setAllItemSuccess(); }.bind(this), diff --git a/src/js/settings.js b/src/js/settings.js index cf11b73..76d0ccd 100644 --- a/src/js/settings.js +++ b/src/js/settings.js @@ -26,8 +26,8 @@ class Settings { this.is_scrolling = $("#settings_scrollToRow").is(":checked"); // attribute panel - this.attributeShowScore = false; - this.attributeShowScoreColor = false; + this.attributeShowScore = true; + this.attributeShowScoreColor = true; this.attributeShowPixelArea = false; this.attributeShowFile = false; -- GitLab