Views
No views yet
| Component | Configuration |
|---|---|
| Architecture | DBNet++ (Differentiable Binarization) |
| Backbone | RepViT (lightweight ViT-inspired CNN) |
| Neck | RSEFPN (in: [48, 96, 192, 384], out: 96) |
| Head | DBNetPPHead (inner: 24, k: 50) |
| Parameters | ~3M |
| Input Size | 640x640 (flexible) |
1from huggingface_hub import hf_hub_download
2import torch
3
4# Download model
5model_path = hf_hub_download(
6 repo_id="thisisiron/dbnetpp_repvit_ch",
7 filename="dbnetpp_repvit_ch.pth"
8)
9
10# Load weights
11state_dict = torch.load(model_path, map_location="cpu")1import torch
2from ocrfactory.models.detect import DBNetPP
3
4# Build model
5model = DBNetPP(
6 backbone={"name": "RepViT"},
7 neck={
8 "name": "RSEFPN",
9 "in_channels": [48, 96, 192, 384],
10 "out_channels": 96,
11 "shortcut": True
12 },
13 head={
14 "name": "DBNetPPHead",
15 "in_channels": 96,
16 "inner_channels": 24,
17 "k": 50,
18 "use_asf": False
19 }
20)
21
22# Load weights
23state_dict = torch.load("dbnetpp_repvit_ch.pth", map_location="cpu")
24model.load_state_dict(state_dict, strict=True)
25model.eval()
26
27# Inference
28x = torch.randn(1, 3, 640, 640)
29with torch.no_grad():
30 output = model(x)
31 shrink_map = output["shrink_map"] # (1, 1, 640, 640)1architecture:
2 backbone:
3 name: RepViT
4 neck:
5 name: RSEFPN
6 in_channels: [48, 96, 192, 384]
7 out_channels: 96
8 shortcut: true
9 head:
10 name: DBNetPPHead
11 in_channels: 96
12 inner_channels: 24
13 k: 50
14 use_asf: false| Dataset | Precision | Recall | H-mean |
|---|---|---|---|
| MSRA-TD500 | - | - | - |