TextNet is a lightweight and efficient architecture designed specifically for text detection, offering superior performance compared to traditional models like MobileNetV3. With variants
TextNet-T,
TextNet-S, and
TextNet-B (6.8M, 8.0M, and 8.9M parameters respectively), it achieves an excellent balance between accuracy and inference speed.
TextNet achieves state-of-the-art results in text detection, outperforming hand-crafted models in both accuracy and speed. Its architecture is highly efficient, making it ideal for GPU-based applications.
1import torch
2import requests
3from PIL import Image
4from transformers import AutoImageProcessor, AutoBackbone
5
6url = "http://images.cocodataset.org/val2017/000000039769.jpg"
7image = Image.open(requests.get(url, stream=True).raw)
8
9processor = AutoImageProcessor.from_pretrained("jadechoghari/textnet-tiny")
10model = AutoBackbone.from_pretrained("jadechoghari/textnet-base")
11
12inputs = processor(image, return_tensors="pt")
13with torch.no_grad():
14 outputs = model(**inputs)
We first compare TextNet with representative hand-crafted backbones,
such as ResNets and VGG16. For a fair comparison,
all models are first pre-trained on IC17-MLT [52] and then
finetuned on Total-Text. The proposed
TextNet models achieve a better trade-off between accuracy
and inference speed than previous hand-crafted models by a
significant margin. In addition, notably, our TextNet-T, -S, and
-B only have 6.8M, 8.0M, and 8.9M parameters respectively,
which are more parameter-efficient than ResNets and VGG16.
These results demonstrate that TextNet models are effective for
text detection on the GPU device.
This model was contributed by
Raghavan,
jadechoghari
and
nielsr.