Downloads · 30 days
0
toontra-research/toontra-manet-bubble-segmentation
toontra-manet-bubble-segmentation is a image segmentation model from toontra-research. Use it for the image segmentation task on the model card, and read the license before you ship it in a product. It is set up for pytorch. The card lists the license as apache-2.0.
MA-Net model for segmenting speech bubbles in webtoon and manga images.
Downloads · 30 days
0
Access
Public
Updated Aug 22, 2026
Repo size
127 MB
Likes
0
Public
Click a slice to open those files.
.pth127 MB · 100%
From the Hugging Face model README
MA-Net model for segmenting speech bubbles in webtoon and manga images.
This checkpoint was trained for use in the public TOONTRA reconstruction.
segmentation-models-pytorchThe model was trained on:
Roboflow manga-segment_v2, version 5
The dataset is not redistributed in this repository and remains subject to its original license and terms.
| Parameter | Value |
|---|---|
| Architecture | MA-Net |
| Encoder | ResNet34 |
| Input size | 512 × 512 |
| Crop padding | 15% |
| Loss | Dice + BCE |
| Optimizer | AdamW |
| Batch size | 8 |
| Best epoch | 18 |
| Threshold | 0.45 |
| Metric | Score |
|---|---|
| Validation Dice | 0.9828 |
| Test Dice | 0.9805 |
| Test IoU | 0.9622 |
import torch
import segmentation_models_pytorch as smp
checkpoint = torch.load(
"manet_bubble_segmentation.pth",
map_location="cpu",
weights_only=True,
)
model = smp.MAnet(
encoder_name="resnet34",
encoder_weights=None,
in_channels=3,
classes=1,
)
model.load_state_dict(checkpoint["state_dict"], strict=True)
model.eval()
threshold = float(checkpoint["threshold"])
The model expects RGB speech-bubble crops. Preserve the crop aspect ratio,
resize it to fit inside a 512 × 512 canvas, and center it on a white
background. Normalize the image with ImageNet mean
[0.485, 0.456, 0.406] and standard deviation
[0.229, 0.224, 0.225].
Apply sigmoid to the model output and use the checkpoint threshold (0.45)
to obtain the binary mask. Remove the letterbox padding and resize the mask
back to the original crop size with nearest-neighbor interpolation.
The model is intended for speech-bubble segmentation in webtoon and manga images.
It expects an approximate speech-bubble crop rather than a complete long webtoon page. A separate detector can be used to locate the bubble before segmentation.
Performance may be lower for unusual bubble styles, transparent bubbles, poorly defined boundaries, or image styles substantially different from the training data.
The checkpoint is released under the Apache License 2.0.
Third-party datasets and libraries remain subject to their respective licenses and terms.