Giter Site home page Giter Site logo

tkyuha / krita-ai-tools Goto Github PK

View Code? Open in Web Editor NEW

This project forked from acly/krita-ai-tools

0.0 0.0 0.0 74 KB

Krita plugin which adds selection tools to mask objects with a single click, or by drawing a bounding box.

License: GNU General Public License v3.0

Shell 5.45% C++ 84.48% CMake 10.07%

krita-ai-tools's Introduction

Krita Segmentation Tools

Plugin which adds selection tools to mask objects in your image with a single click, or by drawing a bounding box.

Select Segment from Point

Click on things to select them!

SegmentFromPoint.mp4

Select Segment from Box

Draw a box around things to select them!

SegmentFromBox.mp4

Limitations

Object detection works quite well in both photos and artwork. As a solution for masking the rough shape of distinct objects and regions it is usually much quicker than lasso tool, and more flexible than contiguous selection tool ("magic wand"). Computation is instantanious for medium resolution on recent hardware (especially GPU), for high resolutions there is a noticeable delay.

The generated masks are binary masks, and typically not pixel-perfect, especially for large resolutions (the mask is always an upscale from 1024x1024). It might be possible to improve with tiling, or a subsequent alpha-matte step.

Installation

The current version of the plugin is built for Krita 5.2.0 and has been confirmed to also work for Krita 5.2.1. Using it with other versions may lead to crashes.

You can download the latest version of the plugin from the releases page.

Windows

Download the plugin and unpack the ZIP archive into your Krita installation folder. Then run Krita.

Linux

You can use this script to download and patch Krita with the plugin. It also creates a shortcut to run it.

To do it manually, get the Krita AppImage from the official source and extract it. This should result in a folder squashfs-root. Download the plugin tar.gz and extract it into that folder. Then run Krita. See the commands below for some environment variables that are needed to run outside the image.

./krita-5.2.0-x86_64.appimage --appimage-extract
tar -xf krita_segmentation_plugin-linux-x64-1.0.2.tar.gz -C squashfs-root/
APPDIR=/squashfs-root APPIMAGE=1 ./squashfs-root/AppRun

Building

The plugin has to be built as part of Krita, see Building Krita from Source.

After GIT checkout, clone this repository into the plugins folder:

cd krita/plugins
git clone https://github.com/Acly/krita-ai-tools.git

Next modify the CMakeLists.txt in the same folder (krita/plugins) by appending the following line:

add_subdirectory( krita-ai-tools )

Now build and install Krita as usual according to official instructions, and the plugin will be built alongside.

Technology

Object detection uses the Segment Anything Model, a deep neural network developed by Meta AI. To get interactive performance on local hardware, an optimized version of the model (MobileSAM) is integrated using the dlimgedit library.

krita-ai-tools's People

Contributors

acly avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.