Downloads · 30 days
23
42% of all-time downloads
ejahdil/mobilenetv3-seg-doc
mobilenetv3-seg-doc is a image segmentation model from ejahdil. 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 cc-by-4.0.
Document-boundary segmenter: given a photo of a page, predicts the region the document occupies. Trained on SmartDoc 2015 Challenge 1 with synthetic background recompositing.
Downloads · 30 days
23
42% of all-time downloads
All-time downloads
55
Public
Repo size
18.5 MB
Likes
0
Public
Click a slice to open those files.
.pt18.5 MB · 100%
From the Hugging Face model README
Document-boundary segmenter: given a photo of a page, predicts the region the document occupies. Trained on SmartDoc 2015 Challenge 1 with synthetic background recompositing.
Measured on held-out documents, not held-out frames: SmartDoc is video, and consecutive frames of one capture are near-duplicates, so a frame-level split would report a number that means nothing.
{'positive': 197, 'ignore': 3}The model emits a mask; the boundary the pipeline consumes is the 4-point quadrilateral fitted to it. Evaluate on the quad, not on pixel IoU — a mask no quad can be fitted to is a failure at the level that matters.
data/segmenter/records{'paper_match': 5051, 'light_desk': 3183, 'wood_desk': 2376, 'denim': 2367, 'background01': 1521, 'background02': 1440, 'background03': 1435, 'background04': 1016, 'tile_floor': 812, 'background05': 633}Backgrounds beyond SmartDoc's own five are synthetic recompositions — the page is warped out of its frame and placed on a generated surface. The largest share is deliberately matched to each page's own paper tone, which is the case a global brightness threshold cannot solve and the reason to train a model at all.
No production or beneficiary imagery was used. Provenance is recorded in the checkpoint and checked before upload.
from huggingface_hub import hf_hub_download
from imgquality.smartdoc_pipeline.segmenter import load_segmenter, predict_mask
from imgquality.verifier_model import pick_device
import cv2
path = hf_hub_download("ejahdil/mobilenetv3-seg-doc", "segmenter.pt")
device = pick_device()
model = load_segmenter(path, device)
mask = predict_mask(model, cv2.imread("page.jpg"), device) # uint8, 0/255
For the fitted quadrilateral rather than the raw mask, pass the mask to
imgquality.metrics.detect_document_region.
Released CC BY 4.0, matching the dataset it was trained on. SmartDoc 2015 Challenge 1 requires attribution:
Jean-Christophe Burie, Joseph Chazalon, Mickael Coustaty, Sebastien Eskenazi, Muhammad Muzzamil Luqman, Maroua Mehri, Nibal Nayef, Jean-Marc Ogier, Sophea Prum and Marcal Rusinol. "ICDAR2015 Competition on Smartphone Document Capture and OCR (SmartDoc)". 13th International Conference on Document Analysis and Recognition (ICDAR), 2015.