Intelligent APIs aim to make machine learning (ML) tasks easier for UWP developers to leverage in their applications without needing ML expertise or creating a new model.
Перейти к файлу
Amrutha Srinivasan b27238ddd5 Pre-build script target change 2021-08-04 08:26:50 -07:00
.github/workflows Modified config for pack command 2021-08-03 18:42:24 -07:00
ImageClassifier Pre-build script target change 2021-08-04 08:26:50 -07:00
IntelligentAPIsTester updated crproj to use msbuild.sdk.extras 2021-08-03 18:45:13 -07:00
ObjectDetector Pre-build script target change 2021-08-04 08:26:50 -07:00
.gitattributes Adding all projects 2021-06-18 09:29:39 -07:00
.gitignore renaming folders, modifying powershell script 2021-07-12 20:00:30 -07:00
IntelligentAPIs.sln updated crproj to use msbuild.sdk.extras 2021-08-03 18:45:13 -07:00
License.md Update License.md 2021-07-15 09:03:05 -07:00
README.md Update README.md 2021-08-03 18:40:36 -07:00
ThirdPartyNotices.txt updated crproj to use msbuild.sdk.extras 2021-08-03 18:45:13 -07:00
global.json updated crproj to use msbuild.sdk.extras 2021-08-03 18:45:13 -07:00

README.md

Intelligent APIs

What are Intelligent APIs?

Intelligent APIs aim to make machine learning tasks easier for developers to leverage in their applications without needing ML expertise or creating a new model. By just importing a nuget package and calling a function, we want developers to be able to build intelligent app experiences without needing to deal with the complexities of inferencing machine learning models on Windows.

Each of these APIs employs WinML (Windows Machine Learning) to use the models on Windows. WinML helps abstract a lot of the model-specific code away and performs hardware optimizations to improve performance significantly on Windows. Learn more about WinML here.

Pre-requisites

Visual Studio 2017 Version 15.7.4 or Newer

Windows 10 - Build 17763 (RS5) or Newer

Windows SDK - Build 17763 (RS5) or Newer

Getting started with the nuget packages

We have 2 nuget packages ready for you to test and play around with. These nuget packages enable you to perform classic machine learning tasks like image classification and object detection in 1-2 lines of code.

Steps to import the nuget package into your project:

  1. Add a new nuget source with the feed URL as https://pkgs.dev.azure.com/dotnet/CommunityToolkit/_packaging/CommunityToolkit-Labs/nuget/v3/index.json. If you have not done this before, follow the steps listed here to add a new nuget package source. Name the source as "Intelligent APIs" and set the URL as https://pkgs.dev.azure.com/dotnet/CommunityToolkit/_packaging/CommunityToolkit-Labs/nuget/v3/index.json.
  2. Open a blank UWP app or an existing app and add one or both packages from the newly created source. Follow step 3 here to do so.
  3. There should be two nuget packages listed, CommunityToolkit.Labs.Intelligent.ImageClassification and CommunityToolkit.Labs.Intelligent.ObjectDetection.

Using the packages

Image Classification

To perform image classification, import the CommunityToolkit.Labs.Intelligent.ImageClassification nuget package. To classify an image, you will need to pass a StorageFile object which is the image file itself, and the number of top results that you want (optional). In the following example, we pass an image of a Rottweiler and we want the top 3 results.

   using CommunityToolkit.Labs.Intelligent.ImageClassification;  
   ...
   List<SqueezeNetResult> imageClasses = await SqueezeNetImageClassifier.ClassifyImage(selectedStorageFile, 3);
drawing

This nuget package performs SqueezeNet model inferencing using WinML. SqueezeNet can detect 1000 different classes.

Object Detection

To perform object detection on your images/video, import the CommunityToolkit.Labs.Intelligent.ObjectDetection nuget package. To detect objects in the image, you can either pass an image file as a StorageFile object, VideoFrame or SoftwareBitmap.

   using CommunityToolkit.Labs.Intelligent.ObjectDetection;
   ...
   List<DetectionResult> listOfObjects = await YOLOObjectDetector.DetectObjects(selectedStorageFile);    

This nuget package performs object detection using YOLOv4 model inference on WinML and also return the co-ordinates of the bounding boxes around the detected objects. YOLOv4 can detect objects of 80 different classes.

drawing

This project is under Community Toolkit Labs. What does that mean?

Community Toolkit Labs is a place for rapidly prototyping ideas and gathering community feedback. It is an incubation space where the developer community can come together to work on new ideas before thinking about final quality gates and ship cycles. Developers can focus on the scenarios and usage of their features before finalizing docs, samples, and tests required to ship a complete idea within the Toolkit.

Steps to clone the repo

  1. git clone the repo
  2. Open the .sln file in VS 2017 or newer
  3. Set IntelligentLabsTest as the startup project.
  4. Build the project and run!