Skip to content

Commit e9291ee

Browse files
committed
Add red border on prediction labels with threshold_deviation >= 0
1 parent 5163efe commit e9291ee

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tigaserver_app/models.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3070,6 +3070,7 @@ def medium_image_(self):
30703070
def medium_image_for_validation_(self, show_prediction: bool = False):
30713071
caption_html = ""
30723072
if show_prediction and hasattr(self, 'prediction') and self.prediction:
3073+
border_style = "border: 2px solid red;" if self.prediction.threshold_deviation >= 0 else ""
30733074
caption_html = '''
30743075
<figcaption title="AI label: {0}" style="
30753076
position: absolute;
@@ -3082,13 +3083,15 @@ def medium_image_for_validation_(self, show_prediction: bool = False):
30823083
border-bottom-right-radius: 4px;
30833084
z-index: 1;
30843085
cursor: default;
3086+
{2}
30853087
">
30863088
<i class="fa fa-magic"></i>
30873089
<span>{1}</span>
30883090
</figcaption>
30893091
'''.format(
30903092
self.prediction.predicted_class,
3091-
self.prediction.taxon.name if self.prediction.taxon else "Off-topic"
3093+
self.prediction.taxon.name if self.prediction.taxon else "Off-topic",
3094+
border_style
30923095
)
30933096

30943097
return '''

0 commit comments

Comments
 (0)