Cyrile's picture
Update README.md
136732b verified
|
raw
history blame
1.62 kB
---
library_name: transformers
tags: []
---
# Model Card for Model ID
<!-- Provide a quick summary of what the model is/does. -->
## Model Details
### Model Description
<!-- Provide a longer summary of what this model is. -->
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
- **Developed by:** [More Information Needed]
- **Funded by [optional]:** [More Information Needed]
- **Shared by [optional]:** [More Information Needed]
- **Model type:** [More Information Needed]
- **Language(s) (NLP):** [More Information Needed]
- **License:** [More Information Needed]
- **Finetuned from model [optional]:** [More Information Needed]
### Model Sources [optional]
<!-- Provide the basic links for the model. -->
- **Repository:** [More Information Needed]
- **Paper [optional]:** [More Information Needed]
- **Demo [optional]:** [More Information Needed]
## Uses
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
### Direct Use
```python
import torch
from transformers import AutoImageProcessor, AutoModel
img_proc = AutoImageProcessor.from_pretrained(
"ArkeaIAF/dit-base-layout-detection"
)
model = AutoModel.from_pretrained(
"ArkeaIAF/dit-base-layout-detection"
)
with torch.inference_mode():
input_ids = img_proc(img, return_tensors='pt')
segmentation = model(**input_ids)
segmentation_mask = img_proc.post_process_semantic_segmentation(
segmentation,
target_sizes=[img.size[::-1]]
)
```