mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 23:26:30 +00:00
gallery manager WIP
This commit is contained in:
@@ -10,10 +10,13 @@ namespace Azaion.Annotator.DTO;
|
||||
|
||||
public class Config
|
||||
{
|
||||
public const string ThumbnailPrefix = "_thumb";
|
||||
|
||||
public string VideosDirectory { get; set; }
|
||||
public string LabelsDirectory { get; set; }
|
||||
public string ImagesDirectory { get; set; }
|
||||
public string ResultsDirectory { get; set; }
|
||||
public string ThumbnailsDirectory { get; set; }
|
||||
|
||||
public List<AnnotationClass> AnnotationClasses { get; set; } = [];
|
||||
|
||||
@@ -31,6 +34,14 @@ public class Config
|
||||
|
||||
public List<string> VideoFormats { get; set; }
|
||||
public List<string> ImageFormats { get; set; }
|
||||
|
||||
public ThumbnailConfig ThumbnailConfig { get; set; }
|
||||
}
|
||||
|
||||
public class ThumbnailConfig
|
||||
{
|
||||
public Size Size { get; set; }
|
||||
public int Border { get; set; }
|
||||
}
|
||||
|
||||
public interface IConfigRepository
|
||||
@@ -48,9 +59,11 @@ public class FileConfigRepository(ILogger<FileConfigRepository> logger) : IConfi
|
||||
private const string DEFAULT_LABELS_DIR = "labels";
|
||||
private const string DEFAULT_IMAGES_DIR = "images";
|
||||
private const string DEFAULT_RESULTS_DIR = "results";
|
||||
private const string DEFAULT_THUMBNAILS_DIR = "thumbnails";
|
||||
|
||||
private static readonly Size DefaultWindowSize = new(1280, 720);
|
||||
private static readonly Point DefaultWindowLocation = new(100, 100);
|
||||
private static readonly Size DefaultThumbnailSize = new(240, 135);
|
||||
|
||||
private static readonly List<string> DefaultVideoFormats = ["mp4", "mov", "avi"];
|
||||
private static readonly List<string> DefaultImageFormats = ["jpg", "jpeg", "png", "bmp"];
|
||||
@@ -68,13 +81,19 @@ public class FileConfigRepository(ILogger<FileConfigRepository> logger) : IConfi
|
||||
LabelsDirectory = Path.Combine(exePath, DEFAULT_LABELS_DIR),
|
||||
ImagesDirectory = Path.Combine(exePath, DEFAULT_IMAGES_DIR),
|
||||
ResultsDirectory = Path.Combine(exePath, DEFAULT_RESULTS_DIR),
|
||||
ThumbnailsDirectory = Path.Combine(exePath, DEFAULT_THUMBNAILS_DIR),
|
||||
|
||||
WindowLocation = DefaultWindowLocation,
|
||||
WindowSize = DefaultWindowSize,
|
||||
ShowHelpOnStart = true,
|
||||
|
||||
VideoFormats = DefaultVideoFormats,
|
||||
ImageFormats = DefaultImageFormats
|
||||
ImageFormats = DefaultImageFormats,
|
||||
ThumbnailConfig = new ThumbnailConfig
|
||||
{
|
||||
Size = DefaultThumbnailSize,
|
||||
Border = 10
|
||||
}
|
||||
};
|
||||
}
|
||||
var str = File.ReadAllText(CONFIG_PATH);
|
||||
|
||||
Reference in New Issue
Block a user