mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 11:06:30 +00:00
put better caption in result image
This commit is contained in:
@@ -278,8 +278,9 @@ public class GalleryService(
|
||||
var brush = new SolidBrush(Color.FromArgb(color.A, color.R, color.G, color.B));
|
||||
var det = new CanvasLabel(detection, new Size(originalImage.Width, originalImage.Height));
|
||||
g.DrawRectangle(new Pen(brush, width: 3), (float)det.X, (float)det.Y, (float)det.Width, (float)det.Height);
|
||||
|
||||
var label = detection.Confidence >= 0.995 ? detClass.UIName : $"{detClass.UIName}: {detection.Confidence * 100:F0}%";
|
||||
g.DrawString(label, new Font(FontFamily.GenericSerif, 14), brush, new PointF((float)(det.X + det.Width / 2.0), (float)det.Y));
|
||||
g.DrawTextBox(label, new PointF((float)(det.X + det.Width / 2.0), (float)(det.Y - 24)), brush, Brushes.Black);
|
||||
}
|
||||
originalImage.Save(Path.Combine(_dirConfig.ResultsDirectory, $"{annotation.Name}{Constants.RESULT_PREFIX}.jpg"), ImageFormat.Jpeg);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user