Skip to content

Commit

Permalink
upgrade to openvino 2025.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sdcb committed Feb 11, 2025
1 parent 8ba9ad2 commit bd1b1ce
Show file tree
Hide file tree
Showing 11 changed files with 97 additions and 66 deletions.
2 changes: 1 addition & 1 deletion build/00-common.linq
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ static void DotNetRun(string args) => Run("dotnet", args.Dump(), Encoding.GetEnc
static void Run(string exe, string args, Encoding encoding) => Util.Cmd(exe, args, encoding);
static ProjectVersion[] Projects = new[]
{
new ProjectVersion("Sdcb.OpenVINO", "0.6.9"),
new ProjectVersion("Sdcb.OpenVINO", "0.6.10"),
new ProjectVersion("Sdcb.OpenVINO.Extensions.OpenCvSharp4", "0.6.8"),
new ProjectVersion("Sdcb.OpenVINO.PaddleOCR", "0.6.8"),
new ProjectVersion("Sdcb.OpenVINO.PaddleOCR.Models.Online", "0.6.2"),
Expand Down
2 changes: 1 addition & 1 deletion generator/Sdcb.OpenVINO.AutoGen/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
IServiceProvider services = ConfigureServices();
//ExtractedInfo info = (await services.GetRequiredService<HeadersDownloader>().DownloadAsync());
AppSettings appSettings = services.GetRequiredService<AppSettings>();
string url = "https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.5/windows/w_openvino_toolkit_windows_2024.5.0.17288.7975fa5da0c_x86_64.zip";
string url = "https://storage.openvinotoolkit.org/repositories/openvino/packages/2025.0/windows/openvino_toolkit_windows_2025.0.0.17942.1f68be9f594_x86_64.zip";
ExtractedInfo info = await HeadersDownloader.DirectDownloadAsync(url, services.GetRequiredService<ArtifactDownloader>(), appSettings.DownloadFolder);
ParsedInfo parsed = HeadersParser.Parse(info);
GeneratedAll all = GeneratedAll.Generate(parsed);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,28 @@ public static ArtifactInfo FromPath(StorageNode sha256Node, SemanticVersion prov
throw new FormatException($"{fileNode.Name} failed to detected as {nameof(ArtifactInfo)}.");
}

KnownOS os = ParseKnownOSChar(match.Groups["os"].Value);
KnownOS os = ParseKnownOSChar(match.Groups["dist"].Value);

return new ArtifactInfo(os, match.Groups["dist"].Value, match.Groups["arch"].Value, providedVersion, sha256Node.LastModified, match.Groups["ext"].Value,
fileNode.FullPath, sha256Node.FullPath);
}

private static KnownOS ParseKnownOSChar(string osChar)
private static KnownOS ParseKnownOSChar(string dist)
{
return osChar switch
return dist switch
{
"l" => KnownOS.Linux,
"m" => KnownOS.MacOS,
"w" => KnownOS.Windows,
_ => throw new FormatException($"Failed to parse {osChar} as {nameof(KnownOS)}.")
"debian10" or "rhel8" or "ubuntu22" or "centos7" or "ubuntu20" or "ubuntu24" => KnownOS.Linux,
"macos_12_6" => KnownOS.MacOS,
"windows" => KnownOS.Windows,
_ => throw new FormatException($"Failed to parse {dist} as {nameof(KnownOS)}.")
};
}

internal static bool NameIdentifier(string name) => name.EndsWith(HashSuffix);
internal static string ArtifactFileExtractor(string name) => name[..(^HashSuffix.Length)];
private const string HashSuffix = ".sha256";

[GeneratedRegex(@"^(?<os>[m|w|l])_openvino_toolkit_(?<dist>\w+)_(?<version>\d{4}\.\d\.\d\.[\w\.]+)_(?<arch>armhf|x86_64|arm64)\.(?<ext>\w+)$")]
[GeneratedRegex(@"^openvino_toolkit_(?<dist>\w+)_(?<version>\d{4}\.\d\.\d\.[\w\.]+)_(?<arch>armhf|x86_64|arm64)\.(?<ext>\w+)$")]
private static partial Regex OpenVINOArtifactNameRegex();

internal static IEnumerable<ArtifactInfo> FromFolder(VersionFolder vf)
Expand Down
4 changes: 2 additions & 2 deletions generator/Sdcb.OpenVINO.NuGetBuilder/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ static async Task Main(string[] args)
IServiceProvider sp = ConfigureServices();
ArtifactDownloader w = sp.GetRequiredService<ArtifactDownloader>();
StorageNodeRoot root = sp.GetRequiredService<StorageNodeRoot>();
string purpose = args.Length > 0 ? args[0] : "win64";
string? versionSuffix = null; // null or "preview.1", can't be ""
string purpose = args.Length > 0 ? args[0] : "linux";
string? versionSuffix = "preview.1"; // null or "preview.1", can't be ""
string dir = Path.Combine(DirectoryUtils.SearchFileInCurrentAndParentDirectories(new DirectoryInfo("."), "OpenVINO.NET.sln").DirectoryName!,
"build", "nupkgs");
VersionFolder vf = root.LatestStableVersion;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="xunit" Version="2.9.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PackageReference Include="coverlet.collector" Version="6.0.4">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="xunit" Version="2.9.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PackageReference Include="coverlet.collector" Version="6.0.4">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="OpenCvSharp4.runtime.win" Version="4.10.0.20240616" />
<PackageReference Include="Sdcb.OpenVINO.runtime.ubuntu.22.04-x64" Version="2024.2.0" />
<PackageReference Include="Sdcb.OpenVINO.runtime.win-x64" Version="2024.2.0" />
<PackageReference Include="xunit" Version="2.9.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PackageReference Include="Sdcb.OpenVINO.runtime.ubuntu.22.04-x64" Version="2025.0.0" />
<PackageReference Include="Sdcb.OpenVINO.runtime.win-x64" Version="2025.0.0" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PackageReference Include="coverlet.collector" Version="6.0.4">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
18 changes: 18 additions & 0 deletions src/Sdcb.OpenVINO/Natives/Enums.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,3 +217,21 @@ public enum ov_preprocess_resize_algorithm_e
/// <summary>nearest algorithm</summary>
RESIZE_NEAREST = 2,
}


/// <summary>This enum contains enumeration for padding mode.</summary>
[CSourceInfo("ov_prepostprocess.h", 101, 106, "ov_prepostprocess_c_api")]
public enum ov_padding_mode_e
{
/// <summary>Pads with given constant value.</summary>
CONSTANT = 0,

/// <summary>Pads with tensor edge values.</summary>
EDGE = 1,

/// <summary>Pads with reflection of tensor data along axis. Values on the edges are not duplicated.</summary>
REFLECT = 2,

/// <summary> Pads similar like `REFLECT` but values on the edges are duplicated.</summary>
SYMMETRIC = 3,
}
Loading

0 comments on commit bd1b1ce

Please sign in to comment.