Skip to content

cospectrum/microwink

Repository files navigation

microwink

github ci

Lightweight instance segmentation of card IDs.

Usage

Python

pip install microwink
from microwink import SegModel
from microwink.common import draw_mask, draw_box
from PIL import Image

seg_model = SegModel.from_path("./models/seg_model.onnx")

img = Image.open("./input.png").convert("RGB")
cards = seg_model.apply(img)

for card in cards:
    print(f"score={card.score}, box={card.box}")
    img = draw_mask(img, card.mask > 0.5)
    img = draw_box(img, card.box)
img.save("./output.png")

About

Lightweight instance segmentation of card IDs

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages