Skip to content

Commit

Permalink
Update READM.md and add a new version of NuGet Package
Browse files Browse the repository at this point in the history
  • Loading branch information
guojin-yan committed Oct 24, 2023
1 parent 6af235c commit 35126cc
Show file tree
Hide file tree
Showing 2 changed files with 147 additions and 41 deletions.
94 changes: 73 additions & 21 deletions modules/csharp_api/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
# OpenVINO™ C# API
![OpenVINO™ C# API](https://socialify.git.ci/guojin-yan/OpenVINO-CSharp-API/image?description=1&descriptionEditable=💞%20OpenVINO%20wrapper%20for%20.NET💞%20&forks=1&issues=1&logo=https%3A%2F%2Fs2.loli.net%2F2023%2F01%2F26%2FylE1K5JPogMqGSW.png&name=1&owner=1&pattern=Circuit%20Board&pulls=1&stargazers=1&theme=Light)

<img src="https://img.shields.io/badge/Framework-.NET6.0%2C%20.NET48-pink.svg">
<p align="center">
<a href="./LICENSE.txt">
<img src="https://img.shields.io/github/license/guojin-yan/openvinosharp.svg">
</a>
<a >
<img src="https://img.shields.io/badge/Framework-.NET5.0%2C%20.NET6.0%2C%20.NET48-pink.svg">
</a>
</p>

[简体中文](README_cn.md) | English

## This is OpenVINO ™ C # API, this project is still under construction and its functions are not yet fully developed. If you have any problems using it, please feel free to communicate with me. If you are interested in this project, you can also join our development.🥰🥰🥰🥰🥰

## 📚 What is OpenVINO™ C# API ?

[OpenVINO™](www.openvino.ai) is an open-source toolkit for optimizing and deploying AI inference.
Expand All @@ -12,17 +21,25 @@
- Use models trained with popular frameworks like TensorFlow, PyTorch and more
- Reduce resource demands and efficiently deploy on a range of Intel® platforms from edge to cloud

&emsp; This project is mainly based on OpenVINO ™ OpenVINO launched by tool kit ™ C # API, aimed at driving OpenVINO ™ Application on the C # platform.
&emsp; This project is based on OpenVINO™ The tool kit has launched OpenVINO™ C # API, aimed at driving OpenVINO™ Application in the C # field. OpenVINO ™ The C # API is based on OpenVINO™ Development, supported platforms, and OpenVINO ™ Consistent, please refer to OpenVINO™ for specific information。

## <img title="NuGet" src="https://s2.loli.net/2023/08/08/jE6BHu59L4WXQFg.png" alt="" width="40">NuGet Package

### Managed libraries

| Package | Description | Link |
| --------------------------- | ------------------------------ | ------------------------------------------------------------ |
| **OpenVINO.CSharp.API** | OpenVINO C# API core libraries | [![NuGet Gallery ](https://badge.fury.io/nu/OpenVINO.CSharp.API.svg)](https://www.nuget.org/packages/OpenVINO.CSharp.API/) |
| **OpenVINO.CSharp.Windows** | All-in-one package for Windows | [![NuGet Gallery ](https://badge.fury.io/nu/OpenVINO.CSharp.Windows.svg)](https://www.nuget.org/packages/OpenVINO.CSharp.Windows/) |

&emsp; OpenVINO ™ The C # API is based on OpenVINO ™ C API development, supported platforms and OpenVINO ™ Consistent, please refer to OpenVINO for specific information ™。
### Native bindings

## <img title="NuGet" src="https://s2.loli.net/2023/01/26/ks9BMwXaHqQnKZP.png" alt="" width="40"> NuGet Package
| Package | Description | Link |
| ------------------------ | --------------------------- | ------------------------------------------------------------ |
| **OpenVINO.runtime.win** | Native bindings for Windows | [![NuGet Gallery ](https://badge.fury.io/nu/OpenVINO.runtime.win.svg)](https://www.nuget.org/packages/OpenVINO.runtime.win/) |
| | | |

&emsp; C # supports NuGet Package installation and one-stop installation on platforms such as Linux and Window. Therefore, in order to facilitate more users, a NuGet Package for use on the Window platform has been released for the convenience of everyone.

| Package | Description | Link |
| ----------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
| **OpenVINO.CSharp.win** | OpenVINO™ C# API core libraries,comes with a complete OpenVINO 2023.0 dependency library | [![NuGet Gallery ](https://badge.fury.io/nu/OpenVINO.CSharp.win.svg)](https://www.nuget.org/packages/OpenVINO.CSharp.win/) |

## ⚙ How to install OpenVINO™ C# API?

Expand All @@ -35,34 +52,69 @@ The following article provides installation methods for OpenVINO™ C# API on di
## 🏷How to use OpenVINO™ C# API?

- **Quick start**
- [Deploying the Yolov8 full series model using OpenVINO™ C# API](demos/yolov8/README.md)

- [Deploying the Yolov8 full series model using OpenVINO™ C# API](https://github.com/guojin-yan/OpenVINO-CSharp-API/blob/csharp3.0/demos/yolov8/README.md)
- **Simple usage**

If you don't know how to use it, simply understand the usage method through the following code.

```c#
using OpenVINOC# API;
namespace test
{
internal class Program
{
static void Main(string[] args)
{
Core core = new Core();
Model model = core.read_model("./model.xml");
CompiledModel compiled_model = core.compiled_model(model, "AUTO");
InferRequest infer_request = compiled_model.create_infer_request();
Tensor input_tensor = infer_request.get_tensor("images");
infer_request.infer();
Tensor output_tensor = infer_request.get_tensor("output0");
core.free();
using Core core = new Core();
using Model model = core.read_model("./model.xml");
using CompiledModel compiled_model = core.compiled_model(model, "AUTO");
using InferRequest infer_request = compiled_model.create_infer_request();
using Tensor input_tensor = infer_request.get_tensor("images");
infer_request.infer();
using Tensor output_tensor = infer_request.get_tensor("output0");
}
}
}
```

The classes and objects encapsulated in the project, such as Core, Model, Tensor, etc., are implemented by calling the C API interface and have unmanaged resources. They need to be handled by calling the **dispose() ** method, otherwise memory leakage may occur.
The classes and objects encapsulated in the project, such as Core, Model, Tensor, etc., are implemented by calling the C API interface and have unmanaged resources. They need to be handled by calling the **Dispose() ** method or `using` statement, otherwise memory leakage may occur.

## 💻 Tutorial Examples

- [Using OpenVINO™ C# API to Deploy the Yolov8 Model on the AIxBoard](https://github.com/guojin-yan/OpenVINO-CSharp-API/blob/csharp3.0/tutorial_examples/AlxBoard_deploy_yolov8/README.md)
- [Pedestrian fall detection - Deploying PP-Human based on OpenVINO C # API](https://github.com/guojin-yan/OpenVINO-CSharp-API/blob/csharp3.0/tutorial_examples/PP-Human_Fall_Detection/README.md)
- [Deploying RT-DETR based on OpenVINO](https://github.com/guojin-yan/RT-DETR-OpenVINO)

## 🗂 API Reference

If you want to learn more information, you can refer to: [OpenVINO™ C# API API Documented](https://guojin-yan.github.io/OpenVINO-CSharp-API.docs/)
If you want to learn more information, you can refer to: [OpenVINO™ C# API API Documented](https://guojin-yan.github.io/OpenVINO-CSharp-API.docs/index.html)

## 🔃 Update log

#### 🔥 **2023.10.22 :Update OpenVINO™ C# API **

- 🗳 **OpenVINO™ C# API :**
- Modify OpenVINO™ errors in the C # API, and integration of code sections to add exception handling mechanisms.
- 🛹**Application Cases:**
- Pedestrian fall detection - Deploying PP-Human based on OpenVINO C # API
- Deploying RT-DETR based on OpenVINO
- 🔮 **NuGet:**
- Abolish the previously released NuGet package, release updated installation packages, and release three types of NuGet packages, including **OpenVINO. CSharp. API **: core code package, **OpenVINO. CSharp. Windows **: Windows platform integration package, and **OpenVINO. runtime. win **: Windows platform runtime package.

#### **2023.6.19 : release OpenVINO™ C# API 3.0**

- 🗳OpenVINO™ C# API :
- Upgrade OpenVINO™ C# API 2.0 to OpenVINO™ C# API 3.0, changing from refactoring the C++API to directly reading OpenVino ™ The official C API makes the application more flexible and supports a richer range of functions.
- 🛹Application Cases:
- OpenVINO™ C# API Deployment Yolov8 Model Example。
- 🔮NuGet:
- Create and publish NuGet package, release * * OpenVINO™ C# API. win 3.0.120 * *, including OpenVino 2023.0 dependencies.

## 🎖 Contribute

&emsp; If you are interested in OpenVINO ™ Interested in using C # and contributing to the open source community, welcome to join us and develop OpenVINO™ C# API together.
&emsp; If you have any ideas or improvement ideas for this project, please feel free to contact us for guidance on our work.

## <img title="" src="https://s2.loli.net/2023/08/08/cijB2K9aDvthEQA.png" alt="" width="40"> License

The release of this project is certified under the [Apache 2.0 license](https://github.com/guojin-yan/OpenVINO™ C# API/blob/OpenVINO™ C# API3.0/LICENSE) .
94 changes: 74 additions & 20 deletions modules/csharp_api/README_cn.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
# OpenVINO™ C# API

<img src="https://img.shields.io/badge/Framework-.NET6.0%2C%20.NET48-pink.svg">
![OpenVINO™ C# API](https://socialify.git.ci/guojin-yan/OpenVINO-CSharp-API/image?description=1&descriptionEditable=💞%20OpenVINO%20wrapper%20for%20.NET💞%20&forks=1&issues=1&logo=https%3A%2F%2Fs2.loli.net%2F2023%2F01%2F26%2FylE1K5JPogMqGSW.png&name=1&owner=1&pattern=Circuit%20Board&pulls=1&stargazers=1&theme=Light)

<p align="center">
<a href="./LICENSE.txt">
<img src="https://img.shields.io/github/license/guojin-yan/openvinosharp.svg">
</a>
<a >
<img src="https://img.shields.io/badge/Framework-.NET5.0%2C%20.NET6.0%2C%20.NET48-pink.svg">
</a>

简体中文| [English](README.md)

## 这是OpenVINO™ C# API,该项目还在建设中,功能还未完善,如使用中有问题,欢迎与我沟通联系。如果对该项目感兴趣,也可以加入到我们的开发中来。🥰🥰🥰🥰



## 📚 简介

[OpenVINO™ ](www.openvino.ai)是一个用于优化和部署 AI 推理的开源工具包。
Expand All @@ -13,17 +22,25 @@
- 使用流行框架(如TensorFlow,PyTorch等)训练的模型
- 减少资源需求,并在从边缘到云的一系列英特尔®平台上高效部署

&emsp; 该项目主要是基于OpenVINO™工具套件推出的 OpenVINO™ C# API,旨在推动 OpenVINO™ 在C#平台的应用。
&emsp; 该项目基于OpenVINO™工具套件推出了 OpenVINO™ C# API,旨在推动 OpenVINO™在C#领域的应用。OpenVINO™ C# API 由于是基于 OpenVINO™ 开发,所支持的平台与OpenVINO™ 一致,具体信息可以参考 OpenVINO™。

## <img title="NuGet" src="https://s2.loli.net/2023/01/26/ks9BMwXaHqQnKZP.png" alt="" width="40">NuGet 包

&emsp; OpenVINO™ C# API 由于是基于 OpenVINO™ C API 开发,所支持的平台与OpenVINO™ 一致,具体信息可以参考 OpenVINO™。
### Managed libraries

## <img title="NuGet" src="https://s2.loli.net/2023/01/26/ks9BMwXaHqQnKZP.png" alt="" width="40"> NuGet Package
| Package | Description | Link |
| --------------------------- | ------------------------------ | ------------------------------------------------------------ |
| **OpenVINO.CSharp.API** | OpenVINO C# API core libraries | [![NuGet Gallery ](https://badge.fury.io/nu/OpenVINO.CSharp.API.svg)](https://www.nuget.org/packages/OpenVINO.CSharp.API/) |
| **OpenVINO.CSharp.Windows** | All-in-one package for Windows | [![NuGet Gallery ](https://badge.fury.io/nu/OpenVINO.CSharp.Windows.svg)](https://www.nuget.org/packages/OpenVINO.CSharp.Windows/) |

### Native bindings

| Package | Description | Link |
| ------------------------ | --------------------------- | ------------------------------------------------------------ |
| **OpenVINO.runtime.win** | Native bindings for Windows | [![NuGet Gallery ](https://badge.fury.io/nu/OpenVINO.runtime.win.svg)](https://www.nuget.org/packages/OpenVINO.runtime.win/) |
| | | |

C# 支持 NuGet Package 方式安装程序包,在Linux、Window 等平台支持一站式安装使用,因此为了方便更多用户使用,目前发行了 Window 平台下使用的 NuGet Package ,方便大家使用。

| Package | Description | Link |
| ----------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
| **OpenVINO.CSharp.win** | OpenVINO™ C# API core libraries,附带完整的OpenVINO 2023.1依赖库 | [![NuGet Gallery ](https://badge.fury.io/nu/OpenVINO.CSharp.win.svg)](https://www.nuget.org/packages/OpenVINO.CSharp.win/) |

## ⚙ 如何安装

Expand All @@ -37,37 +54,74 @@ C# 支持 NuGet Package 方式安装程序包,在Linux、Window 等平台支

- **快速体验**

[使用OpenVINO™ C# API部署Yolov8全系列模型](demos/yolov8/README_cn.md)
[使用OpenVINO™ C# API部署Yolov8全系列模型](https://github.com/guojin-yan/OpenVINO-CSharp-API/blob/csharp3.0/demos/yolov8/README_cn.md)

- **使用方法**

如果你不知道如何使用,通过下面代码简单了解使用方法。

```c#
using OpenVinoSharp; // 引用命名空间
namespace test
{
internal class Program
{
static void Main(string[] args)
{
Core core = new Core(); // 初始化 Core 核心
Model model = core.read_model("./model.xml"); // 读取模型文件
CompiledModel compiled_model = core.compiled_model(model, "AUTO"); // 将模型加载到设备
InferRequest infer_request = compiled_model.create_infer_request(); // 创建推理通道
Tensor input_tensor = infer_request.get_tensor("images"); // 获取输入节点Tensor
using Core core = new Core(); // 初始化 Core 核心
using Model model = core.read_model("./model.xml"); // 读取模型文件
using CompiledModel compiled_model = core.compiled_model(model, "AUTO"); // 将模型加载到设备
using InferRequest infer_request = compiled_model.create_infer_request(); // 创建推理通道
using Tensor input_tensor = infer_request.get_tensor("images"); // 获取输入节点Tensor
infer_request.infer(); // 模型推理
Tensor output_tensor = infer_request.get_tensor("output0"); // 获取输出节点Tensor
core.free(); // 清理 Core 非托管内存
using Tensor output_tensor = infer_request.get_tensor("output0"); // 获取输出节点Tensor
}
}
}
```

项目中所封装的类、对象例如Core、Model、Tensor等,通过调用 C api 接口实现,具有非托管资源,需要调用**dispose()**方法处理,否则就会出现内存泄漏。
项目中所封装的类、对象例如Core、Model、Tensor等,通过调用 C api 接口实现,具有非托管资源,需要调用**Dispose()**方法处理或者使用**using**,否则就会出现内存泄漏。

## 💻 应用案例

- [爱克斯开发板使用OpenVINO™ C# API部署Yolov8模型](https://github.com/guojin-yan/OpenVINO-CSharp-API/blob/csharp3.0/tutorial_examples/AlxBoard_deploy_yolov8/README_cn.md)
- [行人摔倒检测 — 基于 OpenVINO C# API 部署PP-Human](https://github.com/guojin-yan/OpenVINO-CSharp-API/blob/csharp3.0/tutorial_examples/PP-Human_Fall_Detection/README_cn.md)
- [基于 OpenVINO 部署 RT-DETR](https://github.com/guojin-yan/RT-DETR-OpenVINO)

## 🗂 API 文档

如果想了解更多信息,可以参阅:[OpenVINO™ C# API API Documented](https://guojin-yan.github.io/OpenVINO-CSharp-API.docs/)
如果想了解更多信息,可以参阅:[OpenVINO™ C# API API Documented](https://guojin-yan.github.io/OpenVINO-CSharp-API.docs/index.html)

## 🔃 更新日志

#### 🔥 **2023.10.22 :更新OpenVINO™ C# API **

- 🗳 **OpenVINO™ C# API 库:**
- 修改OpenVINO™ C# API 中的错误,并对代码板块进行整合,添加异常处理机制。
- 🛹**应用案例:**
- 行人摔倒检测 — 基于 OpenVINO C# API 部署PP-Human
- 基于 OpenVINO 部署 RT-DETR
- 🔮 **NuGet包:**
- 废除之前发布的NuGet包,发布更新新的安装包,发布三类NuGet包,包括**OpenVINO.CSharp.API**:核心代码包,**OpenVINO.CSharp.Windows**:Windows平台整合包、**OpenVINO.runtime.win**:Windows平台运行库包。

#### **2023.6.19 :发布 OpenVINO™ C# API 3.0**

- 🗳 **OpenVINO™ C# API 库:**
- 升级OpenVINO™ C# API 2.0 到 OpenVINO™ C# API 3.0 版本,由原来的重构 C++ API 改为直接读取 OpenVINO™ 官方 C API,使得应用更加灵活,所支持的功能更加丰富。
- 🛹**应用案例:**
- OpenVINO™ C# API部署Yolov8模型实例。
- 🔮 **NuGet包:**
- 制作并发布NuGet包,发布**OpenVINO™ C# API.win 3.0.120** ,包含OpenVINO 2023.0 依赖项。



## 🎖 贡献

&emsp; 如果您对OpenVINO™ 在C#使用感兴趣,有兴趣对开源社区做出自己的贡献,欢迎加入我们,一起开发OpenVINO™ C# API。

&emsp; 如果你对该项目有一些想法或改进思路,欢迎联系我们,指导下我们的工作。

## <img title="" src="https://user-images.githubusercontent.com/48054808/157835345-f5d24128-abaf-4813-b793-d2e5bdc70e5a.png" alt="" width="40"> 许可证书

本项目的发布受[Apache 2.0 license](LICENSE)许可认证。

0 comments on commit 35126cc

Please sign in to comment.