update dependency library version

This commit is contained in:
辉鸭蛋 2024-07-01 00:51:28 +08:00
parent 7d498f2c35
commit 347e42bab9
12 changed files with 49 additions and 43 deletions

View File

@ -34,35 +34,35 @@
<ItemGroup>
<PackageReference Include="AvalonEdit" Version="6.3.0.90" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Microsoft.ML.OnnxRuntime.DirectML" Version="1.17.1" />
<PackageReference Include="Microsoft.ML.OnnxRuntime.Managed" Version="1.17.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Microsoft.ML.OnnxRuntime.DirectML" Version="1.18.1" />
<PackageReference Include="Microsoft.ML.OnnxRuntime.Managed" Version="1.18.1" />
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2592.51" />
<PackageReference Include="Ookii.Dialogs.Wpf" Version="5.0.1" />
<PackageReference Include="OpenCvSharp4.Extensions" Version="4.8.0.20230708" />
<PackageReference Include="OpenCvSharp4.Windows" Version="4.8.0.20230708" />
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.77" />
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.122" />
<PackageReference Include="MouseKeyHook" Version="5.7.1" />
<PackageReference Include="Sdcb.PaddleInference" Version="2.5.0.1" />
<PackageReference Include="Sdcb.PaddleInference.runtime.win64.openblas" Version="2.5.1" />
<PackageReference Include="Sdcb.PaddleOCR" Version="2.7.0" />
<PackageReference Include="Sdcb.PaddleOCR.Models.Online" Version="2.7.0.1" />
<PackageReference Include="Serilog.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
<PackageReference Include="Serilog.Sinks.RichTextBox.Wpf" Version="1.1.0" />
<PackageReference Include="Vanara.PInvoke.NtDll" Version="3.4.17" />
<PackageReference Include="Vanara.PInvoke.SHCore" Version="3.4.17" />
<PackageReference Include="Vanara.PInvoke.User32" Version="3.4.17" />
<PackageReference Include="WPF-UI" Version="3.0.0-preview.7" />
<PackageReference Include="WPF-UI.Tray" Version="3.0.0-preview.7" />
<PackageReference Include="YoloV8" Version="2.0.1" />
<PackageReference Include="Vanara.PInvoke.NtDll" Version="4.0.2" />
<PackageReference Include="Vanara.PInvoke.SHCore" Version="4.0.2" />
<PackageReference Include="Vanara.PInvoke.User32" Version="4.0.2" />
<PackageReference Include="WPF-UI" Version="3.0.4" />
<PackageReference Include="WPF-UI.Tray" Version="3.0.4" />
<PackageReference Include="YoloV8" Version="4.1.7" />
</ItemGroup>
<ItemGroup Condition=" '$(Configuration)' == 'Debug'">
<PackageReference Include="Microsoft.ClearScript.V8" Version="7.4.4" />
<PackageReference Include="Microsoft.ClearScript.V8.Native.win-x64" Version="7.4.4" />
<PackageReference Include="Microsoft.ClearScript.V8" Version="7.4.5" />
<PackageReference Include="Microsoft.ClearScript.V8.Native.win-x64" Version="7.4.5" />
</ItemGroup>
<ItemGroup>

View File

@ -37,7 +37,7 @@ public class AutoDomainTask
private readonly PostMessageSimulator _simulator;
private readonly YoloV8 _predictor;
private readonly YoloV8Predictor _predictor;
private readonly AutoDomainConfig _config;
@ -48,7 +48,10 @@ public class AutoDomainTask
_taskParam = taskParam;
_simulator = AutoFightContext.Instance.Simulator;
_predictor = new YoloV8(Global.Absolute("Assets\\Model\\Domain\\bgi_tree.onnx"), BgiSessionOption.Instance.Options);
_predictor = YoloV8Builder.CreateDefaultBuilder()
.UseOnnxModel(Global.Absolute("Assets\\Model\\Domain\\bgi_tree.onnx"))
.WithSessionOptions(BgiSessionOption.Instance.Options)
.Build();
_config = TaskContext.Instance().Config.AutoDomainConfig;

View File

@ -38,7 +38,11 @@ public class CombatScenes : IDisposable
public int AvatarCount { get; set; }
private readonly YoloV8 _predictor = new(Global.Absolute("Assets\\Model\\Common\\avatar_side_classify_sim.onnx"), BgiSessionOption.Instance.Options);
private readonly YoloV8Predictor _predictor =
YoloV8Builder.CreateDefaultBuilder()
.UseOnnxModel(Global.Absolute("Assets\\Model\\Common\\avatar_side_classify_sim.onnx"))
.WithSessionOptions(BgiSessionOption.Instance.Options)
.Build();
/// <summary>
/// 通过YOLO分类器识别队伍内角色
@ -117,13 +121,13 @@ public class CombatScenes : IDisposable
speedTimer.Record("角色侧面头像分类识别");
Debug.WriteLine($"角色侧面头像识别结果:{result}");
speedTimer.DebugPrint();
if (result.Confidence < 0.8)
if (result.TopClass.Confidence < 0.8)
{
Cv2.ImWrite(@"log\avatar_side_classify_error.png", src.ToMat());
throw new Exception($"无法识别第{index}位角色,置信度{result.Confidence},结果:{result.Class.Name}");
throw new Exception($"无法识别第{index}位角色,置信度{result.TopClass.Confidence},结果:{result.TopClass.Name.Name}");
}
return result.Class.Name;
return result.TopClass.Name.Name;
}
private void InitializeTeamFromConfig(string teamNames)

View File

@ -36,7 +36,7 @@ namespace BetterGenshinImpact.GameTask.AutoFishing
{
private readonly ILogger<AutoFishingTrigger> _logger = App.GetLogger<AutoFishingTrigger>();
private readonly IOcrService _ocrService = OcrFactory.Paddle;
private readonly YoloV8 _predictor = new(Global.Absolute("Assets\\Model\\Fish\\bgi_fish.onnx"), BgiSessionOption.Instance.Options);
private readonly YoloV8Predictor _predictor = YoloV8Builder.CreateDefaultBuilder().UseOnnxModel(Global.Absolute("Assets\\Model\\Fish\\bgi_fish.onnx")).WithSessionOptions(BgiSessionOption.Instance.Options).Build();
public string Name => "自动钓鱼";
public bool IsEnabled { get; set; }

View File

@ -25,8 +25,7 @@ public class Fishpond
/// </summary>
public List<OneFish> Fishes { get; set; } = new();
public Fishpond(IDetectionResult result)
public Fishpond(DetectionResult result)
{
foreach (var box in result.Boxes)
{
@ -159,4 +158,4 @@ public class Fishpond
return result;
}
}
}

View File

@ -16,13 +16,13 @@
FontFamily="{StaticResource TextThemeFontFamily}"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
mc:Ignorable="d">
<Page.Resources>
<!--<Page.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/View/Controls/Style/ListViewEx.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Page.Resources>
</Page.Resources>-->
<Grid>
<StackPanel Margin="42,16,42,12">
<ui:TextBlock Margin="0,0,0,8"
@ -41,7 +41,7 @@
<!--<ui:Button Command="{Binding StartCalibrationCommand}"
Content="视角校准"
Icon="{ui:SymbolIcon Play24}" />-->
<ListView ItemsSource="{Binding ScriptItems}" SelectionMode="Single">
<ui:ListView ItemsSource="{Binding ScriptItems}" SelectionMode="Single">
<ListView.View>
<GridView>
<GridViewColumn Width="200"
@ -61,7 +61,7 @@
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
</ui:ListView>
</StackPanel>
</Grid>
</Page>

View File

@ -36,7 +36,7 @@ public class BitBltCapture : IGameCapture
Bitmap bitmap = new(width, height);
using System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(bitmap);
var hdcDest = g.GetHdc();
Gdi32.SafeHDC hdcSrc = User32.GetDC(_hWnd == IntPtr.Zero ? User32.GetDesktopWindow() : _hWnd);
var hdcSrc = User32.GetDC(_hWnd == IntPtr.Zero ? User32.GetDesktopWindow() : _hWnd);
Gdi32.StretchBlt(hdcDest, 0, 0, width, height, hdcSrc, x, y, width, height, Gdi32.RasterOperationMode.SRCCOPY);
g.ReleaseHdc();
Gdi32.DeleteDC(hdcDest);
@ -56,4 +56,4 @@ public class BitBltCapture : IGameCapture
_hWnd = IntPtr.Zero;
IsCapturing = false;
}
}
}

View File

@ -14,11 +14,11 @@
<ItemGroup>
<PackageReference Include="SharpDX.Direct3D11" Version="4.2.0" />
<PackageReference Include="SharpDX.DirectInput" Version="4.2.0" />
<PackageReference Include="Vanara.PInvoke.DwmApi" Version="3.4.17" />
<PackageReference Include="Vanara.PInvoke.Gdi32" Version="3.4.17" />
<PackageReference Include="Vanara.PInvoke.User32" Version="3.4.17" />
<PackageReference Include="Vanara.PInvoke.SHCore" Version="3.4.17" />
<PackageReference Include="Vanara.Windows.Extensions" Version="3.4.17" />
<PackageReference Include="Vanara.PInvoke.DwmApi" Version="4.0.2" />
<PackageReference Include="Vanara.PInvoke.Gdi32" Version="4.0.2" />
<PackageReference Include="Vanara.PInvoke.User32" Version="4.0.2" />
<PackageReference Include="Vanara.PInvoke.SHCore" Version="4.0.2" />
<PackageReference Include="Vanara.Windows.Extensions" Version="4.0.2" />
</ItemGroup>
</Project>

View File

@ -11,7 +11,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Vanara.PInvoke.User32" Version="3.4.17" />
<PackageReference Include="Vanara.PInvoke.User32" Version="4.0.2" />
</ItemGroup>
</Project>

View File

@ -10,8 +10,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Vanara.PInvoke.Kernel32" Version="3.4.17" />
<PackageReference Include="Vanara.PInvoke.User32" Version="3.4.17" />
<PackageReference Include="Vanara.PInvoke.Kernel32" Version="4.0.2" />
<PackageReference Include="Vanara.PInvoke.User32" Version="4.0.2" />
</ItemGroup>
</Project>

View File

@ -10,7 +10,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Vanara.PInvoke.User32" Version="3.4.17" />
<PackageReference Include="Vanara.PInvoke.User32" Version="4.0.2" />
</ItemGroup>
</Project>

View File

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
@ -14,7 +14,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.Drawing.Common" Version="7.0.0" />
<PackageReference Include="System.Drawing.Common" Version="8.0.6" />
</ItemGroup>
<ItemGroup>