Skip to content

ppiova/Azure-ComputerVision-BackgroundRemoval

Repository files navigation

Azure Computer Vision Background Removal and Foreground Matting - (version 4.0 preview)

This repository contains a C# program that uses the Azure Computer Vision API to remove backgrounds or apply foreground matting to images.

Prerequisites

  1. An Azure account with an active subscription.
  2. A Computer Vision resource created in the Azure portal.
  3. Your Computer Vision API key and endpoint.
  4. .NET 5.0 or higher installed on your system.

Usage

  1. Clone this repository and navigate to its directory.
  2. Set the following environment variables with your Computer Vision API key and endpoint:
    • COMPUTER_VISION_SUBSCRIPTION_KEY
    • COMPUTER_VISION_ENDPOINT
  3. Update the InputFolder and OutputFolder variables in the Program.cs file with the appropriate input and output folder paths on your system.
  4. Build and run the program.
  5. Select the desired operation: (1) Remove Background or (2) Foreground Matting.
  6. The program will process all valid images in the input folder and save the results in the output folder.

Code Overview

Example image Example image Example image Example image

Additional Documentation to learn more 📚

To learn more about Azure Computer Vision used in this project, please refer to the official Microsoft Learn documentation:

License

This project is licensed under the MIT License. See the LICENSE file for details.

Releases

No releases published

Packages

No packages published

Languages