Skip to content

Latest commit

 

History

History
39 lines (30 loc) · 951 Bytes

README.md

File metadata and controls

39 lines (30 loc) · 951 Bytes

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("./assets/data/us_card.png").convert("RGB")
cards = seg_model.apply(img)

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

License

Apache-2.0