mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 19:56:31 +00:00
fix loader bug with _CACHED_HW_INFO
put tile size to name and set it dynamically for AI recognition
This commit is contained in:
@@ -504,11 +504,13 @@ public partial class Annotator
|
||||
if (files.Count == 0)
|
||||
return;
|
||||
|
||||
await _inferenceService.RunInference(files, DetectionCancellationSource.Token);
|
||||
//TODO: Get Tile Size from UI based on height setup
|
||||
var tileSize = 550;
|
||||
await _inferenceService.RunInference(files, tileSize, DetectionCancellationSource.Token);
|
||||
|
||||
LvFiles.Items.Refresh();
|
||||
_isInferenceNow = false;
|
||||
StatusHelp.Text = "Розпізнавання зваершено";
|
||||
StatusHelp.Text = "Розпізнавання завершено";
|
||||
AIDetectBtn.IsEnabled = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -327,7 +327,7 @@ public class AnnotatorEventHandler(
|
||||
foreach (var res in results)
|
||||
{
|
||||
var time = TimeSpan.Zero;
|
||||
var annotationName = $"{formState.MediaName}{Constants.SPLIT_SUFFIX}{res.Tile.Left:0000}_{res.Tile.Top:0000}!".ToTimeName(time);
|
||||
var annotationName = $"{formState.MediaName}{Constants.SPLIT_SUFFIX}{res.Tile.Width}{res.Tile.Left:0000}_{res.Tile.Top:0000}!".ToTimeName(time);
|
||||
|
||||
var tileImgPath = Path.Combine(dirConfig.Value.ImagesDirectory, $"{annotationName}{Constants.JPG_EXT}");
|
||||
var bitmap = new CroppedBitmap(source, new Int32Rect((int)res.Tile.Left, (int)res.Tile.Top, (int)res.Tile.Width, (int)res.Tile.Height));
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
using System.Drawing;
|
||||
|
||||
namespace Azaion.Annotator.Extensions;
|
||||
|
||||
public static class RectangleFExtensions
|
||||
{
|
||||
public static double Area(this RectangleF rectangle) => rectangle.Width * rectangle.Height;
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Azaion.Annotator;
|
||||
|
||||
public static class SynchronizeInvokeExtensions
|
||||
{
|
||||
public static void InvokeEx<T>(this T t, Action<T> action) where T : ISynchronizeInvoke
|
||||
{
|
||||
if (t.InvokeRequired)
|
||||
t.Invoke(action, [t]);
|
||||
else
|
||||
action(t);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user