-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from cospectrum/dev
change imgs and readme layout
- Loading branch information
Showing
7 changed files
with
19 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,36 @@ | ||
# microwink | ||
Lightweight instance segmentation for card IDs | ||
[![github]](https://github.com/cospectrum/microwink) | ||
[![ci]](https://github.com/cospectrum/microwink/actions) | ||
|
||
## Install | ||
[github]: https://img.shields.io/badge/github-cospectrum/microwink-8da0cb?logo=github | ||
[ci]: https://github.com/cospectrum/microwink/workflows/ci/badge.svg | ||
|
||
Lightweight instance segmentation of card IDs. | ||
|
||
<p> | ||
<img src="assets/data/us_card.png" width="49%"> | ||
<img src="assets/us_card.result.png" width="49%"> | ||
</p> | ||
|
||
## Usage | ||
|
||
### Python | ||
```sh | ||
pip install microwink | ||
``` | ||
|
||
## Usage | ||
```python | ||
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("./tests/data/us_card.png").convert("RGB") | ||
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("./assets/result.png") | ||
img.save("./output.png") | ||
``` | ||
|
||
<p align="middle"> | ||
<img src="./assets/result.png"> | ||
</p> |
File renamed without changes
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes