mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 10:56:31 +00:00
rework to Azaion.Suite
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
using System.Windows;
|
||||
using Azaion.Common.DTO;
|
||||
|
||||
namespace Azaion.Common;
|
||||
|
||||
public class Constants
|
||||
{
|
||||
#region DefaultConfig
|
||||
|
||||
public const string CONFIG_PATH = "config.json";
|
||||
|
||||
public const string DEFAULT_VIDEO_DIR = "video";
|
||||
public const string DEFAULT_LABELS_DIR = "labels";
|
||||
public const string DEFAULT_IMAGES_DIR = "images";
|
||||
public const string DEFAULT_RESULTS_DIR = "results";
|
||||
public const string DEFAULT_THUMBNAILS_DIR = "thumbnails";
|
||||
|
||||
public const int DEFAULT_THUMBNAIL_BORDER = 10;
|
||||
public const double DEFAULT_FRAME_RECOGNITION_SECONDS = 2;
|
||||
public const double TRACKING_DISTANCE_CONFIDENCE = 0.15;
|
||||
public const double TRACKING_PROBABILITY_INCREASE = 15;
|
||||
public const double TRACKING_INTERSECTION_THRESHOLD = 0.8;
|
||||
|
||||
public static readonly Size DefaultWindowSize = new(1280, 720);
|
||||
public static readonly Point DefaultWindowLocation = new(100, 100);
|
||||
public static readonly Size DefaultThumbnailSize = new(240, 135);
|
||||
|
||||
#endregion
|
||||
|
||||
#region Thumbnails
|
||||
|
||||
public const string THUMBNAIL_PREFIX = "_thumb";
|
||||
public const string THUMBNAILS_CACHE_FILE = "thumbnails.cache";
|
||||
|
||||
#endregion
|
||||
|
||||
public static readonly List<AnnotationClass> DefaultAnnotationClasses =
|
||||
[
|
||||
new() { Id = 0, Name = "Броньована техніка", ShortName = "Бронь" },
|
||||
new() { Id = 1, Name = "Вантажівка", ShortName = "Вантаж" },
|
||||
new() { Id = 2, Name = "Машина легкова", ShortName = "Машина" },
|
||||
new() { Id = 3, Name = "Артилерія", ShortName = "Арта" },
|
||||
new() { Id = 4, Name = "Тінь від техніки", ShortName = "Тінь" },
|
||||
new() { Id = 5, Name = "Окопи", ShortName = "Окопи" },
|
||||
new() { Id = 6, Name = "Військовий", ShortName = "Військов" },
|
||||
new() { Id = 7, Name = "Накати", ShortName = "Накати" },
|
||||
new() { Id = 8, Name = "Танк з захистом", ShortName = "Танк захист" },
|
||||
new() { Id = 9, Name = "Дим", ShortName = "Дим" },
|
||||
new() { Id = 10, Name = "Літак", ShortName = "Літак" }
|
||||
];
|
||||
|
||||
public static readonly List<string> DefaultVideoFormats = ["mp4", "mov", "avi"];
|
||||
public static readonly List<string> DefaultImageFormats = ["jpg", "jpeg", "png", "bmp"];
|
||||
|
||||
public static TimeSpan? GetTime(string imagePath)
|
||||
{
|
||||
var timeStr = imagePath.Split("_").LastOrDefault();
|
||||
if (string.IsNullOrEmpty(timeStr) || timeStr.Length < 6)
|
||||
return null;
|
||||
|
||||
//For some reason, TimeSpan.ParseExact doesn't work on every platform.
|
||||
if (!int.TryParse(timeStr[0..1], out var hours))
|
||||
return null;
|
||||
if (!int.TryParse(timeStr[1..3], out var minutes))
|
||||
return null;
|
||||
if (!int.TryParse(timeStr[3..5], out var seconds))
|
||||
return null;
|
||||
if (!int.TryParse(timeStr[5..6], out var milliseconds))
|
||||
return null;
|
||||
return new TimeSpan(0, hours, minutes, seconds, milliseconds * 100);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user