in

Analyzing images with Phi-3 Vision and ONNX model #AIvision

Using Phi-3 Vision with ONNX as local Small Language Model to analyze images | by Sebastian Jensen | medialesson | Jul, 2024

Microsoft recently released their Small Language Models of the Phi family, including the Phi-3 Vision model. This model can be easily used in C# applications with the ONNX version to analyze and work with images. ONNX (Open Neural Network Exchange) is a format that allows AI models to be portable and interoperable across different frameworks and hardware. To get started, download the corresponding ONNX version of the Phi-3 Mini Model and clone it from Hugging Face. Make sure Git LFS is installed before cloning the model.

In Visual Studio, create a new Console application using .NET 8 and install the Spectre.Console and Microsoft.ML.OnnxRuntimeGenAI NuGet packages. Create a Utils folder with a ConsoleHelper class to provide useful methods for interacting with the Spectre.Console package. Additionally, create a Statics class for static prompts and content.

In the Program.cs file, load the model, prepare the tokenizer, and process the image using the Generator class to generate the answer. Display loading messages and prompts throughout the process. Finally, specify the path to the model folder and the image to analyze.

By following these steps, you can integrate the Phi-3 Vision model using ONNX into a .NET Console application for image analysis. This allows you to leverage the capabilities of ONNX for efficient and portable AI model deployment. For the full source code and more details, visit the GitHub repository provided.

Source link

Source link: https://medium.com/medialesson/using-phi-3-vision-with-onnx-as-local-small-language-model-to-analyze-images-a49573dc36a2?source=rss——large_language_models-5

What do you think?

Leave a Reply

GIPHY App Key not set. Please check settings

Why Did OpenAI Keep Its 2023 Hack Secret From The Public?

OpenAI’s 2023 hack kept secret, reasons undisclosed. #transparency

The Best Productivity Apps for 2024 - PCMag AU

#Top10TrustworthyAIModels2024 – Techopedia #AIModels