Update README.md
Browse files
README.md
CHANGED
@@ -68,6 +68,7 @@ The model was trained on a curated dataset of invoice images. Each invoice was a
|
|
68 |
To use this model for inference, you can load it via the Hugging Face Transformers library:
|
69 |
|
70 |
```python
|
|
|
71 |
from PIL import Image
|
72 |
from transformers import (
|
73 |
AdamW,
|
@@ -106,6 +107,17 @@ def run_florence_invoice(img, task_prompt, text_input=None):
|
|
106 |
|
107 |
return parsed_answer
|
108 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
|
110 |
### Applications
|
111 |
This model is ideal for automating the extraction of key information from invoices in various business and financial applications. It can significantly reduce the manual effort required for data entry and validation in accounting and bookkeeping processes.
|
|
|
68 |
To use this model for inference, you can load it via the Hugging Face Transformers library:
|
69 |
|
70 |
```python
|
71 |
+
import torch
|
72 |
from PIL import Image
|
73 |
from transformers import (
|
74 |
AdamW,
|
|
|
107 |
|
108 |
return parsed_answer
|
109 |
```
|
110 |
+
```python
|
111 |
+
## Call the function as follows:
|
112 |
+
### Return all fields identified:
|
113 |
+
|
114 |
+
run_florence_invoice(img, '<OD>')
|
115 |
+
|
116 |
+
### Return Specific field
|
117 |
+
img = './invoice.png'
|
118 |
+
results = run_florence_invoice(img, "<CAPTION_TO_PHRASE_GROUNDING>", text_input="invoice date")
|
119 |
+
|
120 |
+
```
|
121 |
|
122 |
### Applications
|
123 |
This model is ideal for automating the extraction of key information from invoices in various business and financial applications. It can significantly reduce the manual effort required for data entry and validation in accounting and bookkeeping processes.
|