Create README.md
This commit is contained in:
parent
4438765ab7
commit
c9211cbf47
|
@ -0,0 +1,21 @@
|
||||||
|
## Model description
|
||||||
|
detr-doc-table-detection is a model trained to detect both Bordered and Borderless tables in documents based on [facebook/detr-resnet-50](https://huggingface.co/facebook/detr-resnet-50)
|
||||||
|
|
||||||
|
## Training data
|
||||||
|
The model was trained on ICDAR2019 Table Dataset
|
||||||
|
|
||||||
|
### How to use
|
||||||
|
|
||||||
|
```python
|
||||||
|
from transformers import DetrFeatureExtractor, DetrForObjectDetection
|
||||||
|
from PIL import Image
|
||||||
|
import requests
|
||||||
|
image = Image.open("Image path")
|
||||||
|
feature_extractor = DetrFeatureExtractor.from_pretrained('TahaDouaji/detr-doc-table-detection')
|
||||||
|
model = DetrForObjectDetection.from_pretrained('TahaDouaji/detr-doc-table-detection')
|
||||||
|
inputs = feature_extractor(images=image, return_tensors="pt")
|
||||||
|
outputs = model(**inputs)
|
||||||
|
# model predicts bounding boxes and corresponding COCO classes
|
||||||
|
logits = outputs.logits
|
||||||
|
bboxes = outputs.pred_boxes
|
||||||
|
```
|
Loading…
Reference in New Issue