aisop/src/SopHelper.Avalonia/Training/MainViewModel.cs

481 lines
26 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO;
using System.Text.Json;
using Avalonia;
using SopHelper.Presentation.Threading;
using SopHelper.Presentation;
using SopHelper.Presentation.Imaging;
using SopHelper.Engine.Training;
using SopHelper.Engine.Sop;
using Prism.Commands;
using Prism.Mvvm;
namespace SopHelper.Training;
public sealed class MainViewModel : BindableBase
{
private readonly WorkerClient _worker;
private CancellationTokenSource? _cancellation;
private TaskCompletionSource? _completion;
private TrainingProject? _project;
private FrameAnnotation? _selected;
private BitmapImage? _preview;
private bool _busy;
private bool _importing, _stopping;
private Task? _importTask;
private double _progress;
private string _status = "新建项目:导入视频,在任意清晰帧拖动画框";
private string _logs = "";
private bool _isTraining;
private string _trainingStatus = "打开已复核项目后即可开始训练";
private string _trainingMetrics = "尚无训练指标";
private string _latestWeights = "";
private string _trainingRunDirectory = "";
public bool IsTraining { get => _isTraining; private set => SetProperty(ref _isTraining, value); }
public string TrainingStatus { get => _trainingStatus; private set => SetProperty(ref _trainingStatus, value); }
public string TrainingMetrics { get => _trainingMetrics; private set => SetProperty(ref _trainingMetrics, value); }
public string LatestWeights { get => _latestWeights; private set => SetProperty(ref _latestWeights, value); }
private string _latestOnnx = "";
public string LatestOnnx { get => _latestOnnx; private set => SetProperty(ref _latestOnnx, value); }
public string TrainingRunDirectory { get => _trainingRunDirectory; private set => SetProperty(ref _trainingRunDirectory, value); }
public string? VideoImportDirectory { get; set; }
public string Root { get; }
public TrainingProject? Project => _project;
public ObservableCollection<FrameAnnotation> Frames { get; } = [];
public bool IsBusy { get => _busy; private set { SetProperty(ref _busy, value); RaisePropertyChanged(nameof(IsIdle)); Commands.ForEach(c => c.RaiseCanExecuteChanged()); } }
public bool IsIdle => !IsBusy && !IsImporting && !_stopping;
public bool IsImporting
{
get => _importing;
private set { SetProperty(ref _importing, value); RaisePropertyChanged(nameof(IsIdle)); Commands.ForEach(c => c.RaiseCanExecuteChanged()); }
}
public double Progress { get => _progress; set => SetProperty(ref _progress, value); }
public string Status { get => _status; set => SetProperty(ref _status, value); }
public string Logs { get => _logs; set => SetProperty(ref _logs, value); }
public string Summary => _project == null ? "尚未导入视频" : $"{_project.Width} × {_project.Height} · {Frames.Count} 帧 · 已复核 {Frames.Count(f => f.Status is "reviewed" or "absent")} · 待复核 {Frames.Count(f => f.Status == "auto")}";
public string FrameInfo => _selected == null || _project == null ? "拖动画框以标记零件" : $"第 {_selected.Index + 1} 帧 · 原视频帧 {_selected.SourceIndex} · {(_project.Fps > 0 ? (_selected.SourceIndex / _project.Fps).ToString("F2") + " 秒" : "时间未知")} · {_selected.Display}";
public string ProjectPath => _project?.FilePath ?? "项目会自动保存到你选择的文件夹";
public BitmapImage? Preview { get => _preview; private set => SetProperty(ref _preview, value); }
public double[]? CurrentBox => _selected?.Box;
public FrameAnnotation? SelectedFrame
{
get => _selected;
set
{
if (!SetProperty(ref _selected, value)) return;
try
{
if (value != null && _project != null)
{
var bitmap = new BitmapImage();
bitmap.BeginInit(); bitmap.CacheOption = BitmapCacheOption.OnLoad;
bitmap.UriSource = new Uri(Path.Combine(_project.DirectoryPath, value.Image));
bitmap.EndInit(); bitmap.Freeze(); Preview = bitmap;
}
}
catch (Exception e) { Status = "图像读取失败:" + e.Message; Preview = null; }
RaisePropertyChanged(nameof(CurrentBox)); RaisePropertyChanged(nameof(FrameInfo));
}
}
// Configuration is saved locally, except the API key which is passed only through the worker environment.
private static string PythonPath => DesktopPlatform.PythonPath;
public ObservableCollection<string> Recipes { get; } = [];
private string _recipeName = "";
private bool _recipeLocked;
public void BindRecipe(string name)
{
RecipeName = name;
_recipeLocked = true;
}
public string RecipeName
{
get => _recipeName;
set
{
if (_recipeLocked && value != _recipeName) throw new InvalidOperationException("标注与训练固定使用当前编辑的配方,请打开其他配方的编辑窗口再操作");
if (!SetProperty(ref _recipeName, value)) return;
LoadSettings();
if (_project is not null && _project.RecipeName != value)
{
_project=null;Label="";SelectedFrame=null;Frames.Clear();Preview=null;
RaisePropertyChanged(nameof(Project));RaisePropertyChanged(nameof(Summary));RaisePropertyChanged(nameof(ProjectPath));
Status="已切换配方,请导入视频或打开该配方的标注项目";
}
LoadTrainingResult();
RefreshPartNames();
RaisePropertyChanged(nameof(RecipeFolder));
}
}
public string RecipeFolder => string.IsNullOrWhiteSpace(RecipeName) ? "请先选择配方" : RecipeDirectoryFor(RecipeName);
private string RecipeDirectoryFor(string name)
{
if (string.IsNullOrWhiteSpace(name) || name.IndexOfAny(Path.GetInvalidFileNameChars()) >= 0 || name is "." or "..")
throw new ArgumentException("请先选择有效的配方");
return DesktopPlatform.Recipes.DirectoryFor(name);
}
public ObservableCollection<string> PartNames { get; } = [];
private string _label = "";
public string Label { get => _label; private set => SetProperty(ref _label, value); }
public Func<IReadOnlyList<string>, Task<string?>>? SelectImportPartAsync { get; set; }
public Func<Task<string?>>? SelectImportVideoAsync { get; set; }
public void RefreshPartNames()
{
PartNames.Clear();
if (!string.IsNullOrWhiteSpace(RecipeName))
{
var path = DesktopPlatform.Recipes.ConfigPath(RecipeName);
if (File.Exists(path))
foreach (var name in PartCatalog.Read(SopConfigLoader.Load(path), RecipeDirectoryFor(RecipeName))) PartNames.Add(name);
}
}
private void ValidatePart(string name)
{
RefreshPartNames();
if (!PartNames.Contains(name)) throw new InvalidOperationException("目标零件不在当前配方的零件列表中,请先维护并保存零件列表,再重新导入视频");
}
public int ExtractStride { get; set; } = 1;
public int MaxFrames { get; set; } = 600;
public string Checkpoint { get; set; } = "";
public string SamConfig { get; set; } = "configs/sam2.1/sam2.1_hiera_t.yaml";
public string Device { get; set; } = "auto";
public int ExportEvery { get; set; } = 5;
public int Epochs { get; set; } = 50;
public int Batch { get; set; } = 4;
public int ImageSize { get; set; } = 640;
public string Model { get; set; } = "yolo11n.pt";
public string Endpoint { get; set; } = "https://api.example.com/v1";
public string ApiModel { get; set; } = "";
public string Description { get; set; } = "";
public Func<string>? ReadApiKey { get; set; }
public DelegateCommand ImportCommand { get; }
public DelegateCommand OpenCommand { get; }
public DelegateCommand SaveParametersCommand { get; }
public DelegateCommand DoctorCommand { get; }
public DelegateCommand PropagateCommand { get; }
public DelegateCommand ExportCommand { get; }
public DelegateCommand TrainCommand { get; }
public DelegateCommand PickTrainingModelCommand { get; }
public DelegateCommand OpenTrainingResultsCommand { get; }
public DelegateCommand OnnxCommand { get; }
public DelegateCommand SuggestCommand { get; }
public DelegateCommand ApproveCommand { get; }
public DelegateCommand ApproveAllCommand { get; }
public DelegateCommand AbsentCommand { get; }
public DelegateCommand ExcludeCommand { get; }
public DelegateCommand PreviousCommand { get; }
public DelegateCommand NextCommand { get; }
public DelegateCommand CancelCommand { get; }
public DelegateCommand RevealCommand { get; }
private List<DelegateCommand> Commands { get; } = [];
public MainViewModel(WorkerClient worker)
{
_worker = worker;
Root = DesktopPlatform.WorkspaceRoot;
LoadSettings();
SaveParametersCommand = Command(() =>
{
SaveSettings();
Status = "参数已保存,下次打开时自动恢复";
});
ImportCommand = new DelegateCommand(() => _importTask = ImportAsync(), () => IsIdle);
Commands.Add(ImportCommand);
OpenCommand = Command(async () =>
{
var partsDirectory = Path.Combine(RecipeDirectoryFor(RecipeName), "parts");
Directory.CreateDirectory(partsDirectory);
var dialog = new OpenFileDialog { Filter = "标注项目|project.json", InitialDirectory = partsDirectory };
if (await dialog.ShowDialogAsync() == true) Load(dialog.FileName);
});
DoctorCommand = Command(async () => await Run(new { action = "doctor" }, reload: false));
PropagateCommand = Command(async () => { ValidateProjectTarget(); await Run(new { action = "propagate", project = RequireProject().FilePath, checkpoint = Checkpoint, config = SamConfig, device = Device }); });
ExportCommand = Command(async () => { ValidateProjectTarget(); await Run(Request("export")); });
TrainCommand = Command(async () => { ValidateProjectTarget(); await Run(Request("train")); });
PickTrainingModelCommand = Command(async () =>
{
var dialog = new OpenFileDialog { Filter = "YOLO模型|*.pt;*.yaml;*.yml" };
if (await dialog.ShowDialogAsync() == true) { Model = dialog.FileName; RaisePropertyChanged(nameof(Model)); }
});
OpenTrainingResultsCommand = Command(() =>
{
var directory = TrainingRunDirectory;
if (!Directory.Exists(directory)) throw new DirectoryNotFoundException("尚无训练结果目录,请先完成一次训练");
DesktopPlatform.Reveal(directory);
});
OnnxCommand = Command(async () => { ValidateProjectTarget(); await Run(Request("onnx")); });
SuggestCommand = Command(async () =>
{
ValidateProjectTarget();
if (SelectedFrame == null) throw new InvalidOperationException("请先选择帧");
await Run(new { action = "suggest", project = RequireProject().FilePath, index = SelectedFrame.Index,
endpoint = Endpoint, apiModel = ApiModel, description = Description }, apiKey: ReadApiKey?.Invoke());
});
ApproveCommand = Command(() => Update("reviewed"));
ApproveAllCommand = Command(ApproveAll);
AbsentCommand = Command(() => Update("absent"));
ExcludeCommand = Command(() => Update("excluded"));
PreviousCommand = Command(() => Move(-1));
NextCommand = Command(() => Move(1));
CancelCommand = new DelegateCommand(() => _cancellation?.Cancel());
RevealCommand = Command(() =>
{
var directory=RecipeDirectoryFor(RecipeName);Directory.CreateDirectory(directory);DesktopPlatform.Reveal(directory);
});
}
private DelegateCommand Command(Action action)
{
var command = new DelegateCommand(() => { try { action(); } catch (Exception e) { Status = e.Message; Append(e.Message); } }, () => IsIdle);
Commands.Add(command); return command;
}
private DelegateCommand Command(Func<Task> action)
{
var command = new DelegateCommand(async () =>
{
try { await action(); }
catch (Exception e) { Status = e.Message; Append(e.Message); }
}, () => IsIdle);
Commands.Add(command); return command;
}
// Async operations catch their own exceptions inside Run. Import does synchronous validation before awaiting.
private object Request(string action) => new { action, project = RequireProject().FilePath, every = ExportEvery,
valRatio = 0.2, epochs = Epochs, imageSize = ImageSize, batch = Batch, model = "yolo11n.pt", device = Device,
outputDirectory = Path.Combine(RequireProject().RecipeDirectory, "runs") };
private TrainingProject RequireProject() => _project ?? throw new InvalidOperationException("请先导入视频或打开项目");
private void ValidateProjectTarget()
{
var project = RequireProject();
ValidatePart(Label);
if (project.Name != Label) throw new InvalidOperationException("标注项目的目标零件已被修改,请重新打开正确的项目;目标零件不能在标注或训练时切换");
if (string.IsNullOrWhiteSpace(project.RecipeDirectory))
{
project.RecipeDirectory = RecipeDirectoryFor(RecipeName);
project.RecipeName = RecipeName;
}
if (project.RecipeName != RecipeName) throw new InvalidOperationException("当前视频属于配方“" + project.RecipeName + "”,请切回该配方;新配方请导入新视频");
project.Save();
}
private async Task ImportAsync()
{
if (!IsIdle) return;
IsImporting = true;
try
{
var recipeDirectory = RecipeDirectoryFor(RecipeName);
RefreshPartNames();
if (PartNames.Count == 0) throw new InvalidOperationException("请先在配方编辑的“零件列表”中添加并保存目标零件,再导入视频");
if (SelectImportPartAsync is null) throw new InvalidOperationException("请在标注页面导入视频并选择目标零件");
var target = await SelectImportPartAsync(PartNames.ToArray());
if (_stopping || string.IsNullOrEmpty(target)) { Status = "已取消导入,原标注项目保持不变"; return; }
ValidatePart(target);
string? videoPath;
if (SelectImportVideoAsync is not null) videoPath = await SelectImportVideoAsync();
else
{
var video = new OpenFileDialog { Filter = "视频|*.mp4;*.avi;*.mov;*.mkv;*.wmv|所有文件|*.*", InitialDirectory = Path.Combine(recipeDirectory, "recordings") };
videoPath = await video.ShowDialogAsync() == true ? video.FileName : null;
}
if (_stopping || string.IsNullOrWhiteSpace(videoPath)) { Status = "已取消导入,原标注项目保持不变"; return; }
ValidatePart(target);
var output = Path.Combine(recipeDirectory, "parts", "part-" + DateTime.Now.ToString("yyyyMMdd-HHmmss") + "-" + Guid.NewGuid().ToString("N")[..4]);
if (await Run(new { action = "extract", video = videoPath, output, name = target, recipeName = RecipeName, recipeDirectory, stride = ExtractStride, maxFrames = MaxFrames }, reload: false))
Load(Path.Combine(output, "project.json"));
}
catch (Exception e) { Status = e.Message; Append(e.Message); }
finally { IsImporting = false; }
}
public void Load(string path, int index = 0)
{
var incoming = TrainingProject.Load(path);
if (_recipeLocked && !string.IsNullOrWhiteSpace(incoming.RecipeName) && incoming.RecipeName != RecipeName)
throw new InvalidOperationException("该标注项目属于其他配方,请在对应配方的编辑窗口中打开");
var name = string.IsNullOrWhiteSpace(incoming.RecipeName) ? RecipeName : incoming.RecipeName;
path = DesktopPlatform.Recipes.ImportProject(name, path);
_project = TrainingProject.Load(path);
if (!string.IsNullOrWhiteSpace(_project.RecipeName))
{
if (!Recipes.Contains(_project.RecipeName)) Recipes.Add(_project.RecipeName);
RecipeName = _project.RecipeName;
}
Label = _project.Name; RaisePropertyChanged(nameof(Label));
RefreshPartNames();
_selected = null; Frames.Clear();
foreach (var frame in _project.Frames) Frames.Add(frame);
SelectedFrame = Frames[Math.Clamp(index, 0, Frames.Count - 1)];
RaisePropertyChanged(nameof(Summary)); RaisePropertyChanged(nameof(ProjectPath));
LoadTrainingResult();
if (!IsBusy) Status = "项目已打开;拖动画框或选择帧进行复核";
}
public void DrawBox(double[] box)
{
if (IsBusy || SelectedFrame == null || _project == null) return;
try
{
_project.ValidateBox(box); SelectedFrame.Box = box; SelectedFrame.Prompt = true;
SelectedFrame.Status = "reviewed"; _project.Save(); Refresh();
Status = "关键帧已保存;可再选其他角度画框,或开始自动标注";
}
catch (Exception e) { Status = e.Message; }
}
private void Update(string status)
{
if (SelectedFrame == null) return;
if (status == "reviewed" && SelectedFrame.Box == null) throw new InvalidOperationException("该帧没有目标框,请画框或标记无目标");
SelectedFrame.Status = status;
if (status != "reviewed") { SelectedFrame.Box = null; SelectedFrame.Prompt = false; }
RequireProject().Save(); Refresh();
Status = "当前帧已保存";
}
private void ApproveAll()
{
var project = RequireProject();
var pending = project.Frames.Where(frame => frame.Status == "auto" && frame.Box != null).ToList();
// Validate the whole batch before changing any annotation status.
foreach (var frame in pending) project.ValidateBox(frame.Box!);
if (pending.Count == 0) { Status = "没有带目标框的待复核帧"; return; }
var selectedIndex = SelectedFrame?.Index ?? 0;
foreach (var frame in pending) frame.Status = "reviewed";
try { project.Save(); }
catch
{
foreach (var frame in pending) frame.Status = "auto";
throw;
}
Load(project.FilePath, selectedIndex);
Status = $"一键复核完成:已确认 {pending.Count} 帧并保存";
}
private void Refresh()
{
var frame = SelectedFrame;
if (frame == null) return;
var index = Frames.IndexOf(frame); Frames[index] = frame;
SelectedFrame = frame;
RaisePropertyChanged(nameof(CurrentBox)); RaisePropertyChanged(nameof(FrameInfo)); RaisePropertyChanged(nameof(Summary));
}
private void Move(int delta)
{
if (Frames.Count > 0) SelectedFrame = Frames[Math.Clamp(Frames.IndexOf(SelectedFrame!) + delta, 0, Frames.Count - 1)];
}
private void Append(string line)
{
Dispatcher.CurrentDispatcher.Invoke(() =>
{
Logs += line + Environment.NewLine;
if (Logs.Length > 40000) Logs = Logs[^30000..];
});
}
private async Task<bool> Run(object request, bool reload = true, string? apiKey = null)
{
if (IsBusy) return false;
IsTraining = JsonSerializer.SerializeToElement(request).GetProperty("action").GetString() == "train";
if (IsTraining) { TrainingStatus = "正在准备数据与模型…"; TrainingMetrics = "等待首轮训练指标"; }
IsBusy = true; Progress = 0; Status = "任务运行中…";
_cancellation = new CancellationTokenSource();
_completion = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously);
var path = _project?.FilePath; var index = SelectedFrame?.Index ?? 0;
try
{
SaveSettings();
if (!File.Exists(PythonPath))
throw new FileNotFoundException(DesktopPlatform.MissingPythonMessage, PythonPath);
await _worker.RunAsync(PythonPath, Path.Combine(DesktopPlatform.ApplicationRoot, "tools", "worker.py"), request, line =>
{
try
{
using var json = JsonDocument.Parse(line);
var item = json.RootElement;
var message = item.TryGetProperty("message", out var m) ? m.GetString() ?? line : line;
Append(message);
Dispatcher.CurrentDispatcher.Invoke(() =>
{
Status = message;
if (item.TryGetProperty("progress", out var progress) && (!IsTraining || item.TryGetProperty("event", out _))) Progress = Math.Clamp(progress.GetDouble(), 0, 1) * 100;
if (IsTraining)
{
TrainingStatus = message;
if (item.TryGetProperty("metrics", out var metrics)) TrainingMetrics = FormatMetrics(metrics);
if (item.TryGetProperty("runDirectory", out var directory)) TrainingRunDirectory = directory.GetString() ?? "";
if (item.TryGetProperty("weights", out var weights)) LatestWeights = weights.GetString() ?? "";
}
if (item.TryGetProperty("onnx", out var onnx)) LatestOnnx = onnx.GetString() ?? "";
});
if (item.TryGetProperty("modules", out var modules)) Append(modules.ToString());
if (item.TryGetProperty("output", out var output)) Append(output.GetString() ?? "");
}
catch (Exception e) when (e is JsonException or InvalidOperationException or FormatException) { Append(line); }
}, _cancellation.Token, apiKey);
Progress = 100; return true;
}
catch (OperationCanceledException) { Status = "任务已取消;已保存的标注保留"; if (IsTraining) TrainingStatus = "训练已停止;已写入的日志与检查点保留在结果目录"; Append(Status); return false; }
catch (Exception e) { Status = e.Message; if (IsTraining) TrainingStatus = "训练失败,请查看运行日志:" + e.Message; Append(e.Message); return false; }
finally
{
if (reload && path != null)
{
try { Load(path, index); } catch (Exception e) { Append("重新读取项目失败:" + e.Message); }
}
_cancellation.Dispose(); _cancellation = null; IsBusy = false; IsTraining = false;
_completion.TrySetResult();
}
}
public void Cancel() => _cancellation?.Cancel();
public async Task StopAsync()
{
_stopping = true; RaisePropertyChanged(nameof(IsIdle)); Commands.ForEach(c => c.RaiseCanExecuteChanged());
Cancel();
if (_completion != null) await _completion.Task;
if (_importTask != null) await _importTask;
}
private static string FormatMetrics(JsonElement metrics) => string.Join(Environment.NewLine,
metrics.EnumerateObject().Where(m => m.Value.ValueKind == JsonValueKind.Number)
.Select(m => $"{m.Name}: {m.Value.GetDouble():F4}"));
private void LoadTrainingResult()
{
if (IsTraining) return;
LatestWeights = ""; LatestOnnx = ""; TrainingRunDirectory = ""; TrainingMetrics = "尚无训练指标";
if (string.IsNullOrWhiteSpace(RecipeName)) return;
var file = Path.Combine(RecipeDirectoryFor(RecipeName), "latest-model.json");
if (!File.Exists(file)) return;
try
{
using var result = JsonDocument.Parse(File.ReadAllText(file));
LatestWeights = result.RootElement.GetProperty("weights").GetString() ?? "";
if (result.RootElement.TryGetProperty("onnx", out var onnx)) LatestOnnx = onnx.GetString() ?? "";
else if (File.Exists(Path.ChangeExtension(LatestWeights, ".onnx"))) LatestOnnx = Path.ChangeExtension(LatestWeights, ".onnx");
TrainingRunDirectory = result.RootElement.TryGetProperty("runDirectory", out var directory) ? directory.GetString() ?? "" : Path.GetDirectoryName(Path.GetDirectoryName(LatestWeights)) ?? "";
if (result.RootElement.TryGetProperty("metrics", out var metrics)) TrainingMetrics = FormatMetrics(metrics);
}
catch (Exception e) { Append("读取训练结果失败:" + e.Message); }
}
private void SaveSettings()
{
var directory = RecipeDirectoryFor(RecipeName);
Directory.CreateDirectory(directory);
File.WriteAllText(Path.Combine(directory, "training-settings.json"), JsonSerializer.Serialize(new
{ Checkpoint, SamConfig, Device, ExportEvery, Epochs, Batch, ImageSize, Model, Endpoint, ApiModel, Description, ExtractStride, MaxFrames }));
}
private void LoadSettings()
{
var path = string.IsNullOrWhiteSpace(RecipeName) ? Path.Combine(Root, "workspace", "settings.json")
: Path.Combine(RecipeDirectoryFor(RecipeName), "training-settings.json");
// 新配方使用默认参数,避免沿用刚刚查看的其他配方。
ExtractStride=1; MaxFrames=600; ExportEvery=5; Epochs=50; Batch=4; ImageSize=640;
Checkpoint=""; SamConfig="configs/sam2.1/sam2.1_hiera_t.yaml"; Device="auto";
Model="yolo11n.pt"; Endpoint="https://api.example.com/v1"; ApiModel=""; Description="";
foreach (var property in GetType().GetProperties().Where(p => p.CanWrite)) RaisePropertyChanged(property.Name);
if (!File.Exists(path)) return;
try
{
using var settings = JsonDocument.Parse(File.ReadAllText(path));
foreach (var item in settings.RootElement.EnumerateObject())
{
var property = GetType().GetProperty(item.Name);
if (property?.SetMethod?.IsPublic == true && property.PropertyType == typeof(string)) property.SetValue(this, item.Value.GetString());
else if (property?.SetMethod?.IsPublic == true && property.PropertyType == typeof(int)) property.SetValue(this, item.Value.GetInt32());
if (property?.SetMethod?.IsPublic == true) RaisePropertyChanged(property.Name);
}
}
catch (Exception) { Status = "设置文件不可读,已使用默认配置"; }
}
}