Skip to content

Lift subjects from images like you can do in iPhone but in desktop.

License

Notifications You must be signed in to change notification settings

trrahul/subject-lift

Repository files navigation

SubjectLift

SubjectLift is a desktop application built using Avalonia UI and C#. It allows to segment objects in your images like you can do in iPhone. This project is an exercise in using Segment Anything Model and ONNX with C#. There are a lot of improvements that can be made in code performance, segmentation and UX. This project represents a reference for using a model ported to ONNX with C#.

The inference is very slow and runs on the CPU. It can be made to run in the GPU but you will need to install additional software from NVIDIA so I skipped it.

Features

  • Open Image: Load an image into the application using Ctrl+O.
  • Segment Subject: Click on a subject within the image to get the segmented mask and display it.

Screenshots

Source Image

Original

Generated Mask

OriginalWithMask

Mask applied to source

MaskedResult

Final UI

FinalResult

Technologies Used

Getting Started

Prerequisites

Installation

  1. Clone the repository
  2. Download the encoder and decoder models from this link and place them in the Models folder where the executable is located. Usually SubjectLift.Desktop\bin\Debug\net8.0\Models

Running the Application

  1. Open the project in your IDE.
  2. Build the project.
  3. Run the application.

Project Structure

  • App.axaml.cs: Entry point of the application.
  • Views/MainWindow.axaml: XAML layout for the main window.
  • Views/MainWindow.axaml.cs: Code-behind for the main window.
  • Controls/MaskedImage.cs: Custom control for displaying images with masks.

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.

License

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

About

Lift subjects from images like you can do in iPhone but in desktop.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages