leoxiaobin
commited on
Commit
•
f3c2bbf
1
Parent(s):
9896a44
Update README.md
Browse files
README.md
CHANGED
@@ -110,20 +110,7 @@ Here are the tasks `Florence-2` could perform:
|
|
110 |
<details>
|
111 |
<summary> Click to expand </summary>
|
112 |
|
113 |
-
### OCR
|
114 |
|
115 |
-
```python
|
116 |
-
prompt = "<OCR>"
|
117 |
-
run_example(prompt)
|
118 |
-
```
|
119 |
-
|
120 |
-
### OCR with Region
|
121 |
-
OCR with region output format:
|
122 |
-
{'\<OCR_WITH_REGION>': {'quad_boxes': [[x1, y1, x2, y2, x3, y3, x4, y4], ...], 'labels': ['text1', ...]}}
|
123 |
-
```python
|
124 |
-
prompt = "<OCR_WITH_REGION>"
|
125 |
-
run_example(prompt)
|
126 |
-
```
|
127 |
|
128 |
### Caption
|
129 |
```python
|
@@ -143,6 +130,16 @@ prompt = "<MORE_DETAILED_CAPTION>"
|
|
143 |
run_example(prompt)
|
144 |
```
|
145 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
### Object Detection
|
147 |
|
148 |
OD results format:
|
@@ -172,14 +169,20 @@ prompt = "<REGION_PROPOSAL>"
|
|
172 |
run_example(prompt)
|
173 |
```
|
174 |
|
175 |
-
### Caption to Phrase Grounding
|
176 |
-
caption to phrase grounding task requires additional text input, i.e. caption.
|
177 |
|
178 |
-
|
179 |
-
|
180 |
```python
|
181 |
-
|
182 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
183 |
```
|
184 |
|
185 |
for More detailed examples, please refer to [notebook](https://huggingface.co/microsoft/Florence-2-large/blob/main/sample_inference.ipynb)
|
|
|
110 |
<details>
|
111 |
<summary> Click to expand </summary>
|
112 |
|
|
|
113 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
|
115 |
### Caption
|
116 |
```python
|
|
|
130 |
run_example(prompt)
|
131 |
```
|
132 |
|
133 |
+
### Caption to Phrase Grounding
|
134 |
+
caption to phrase grounding task requires additional text input, i.e. caption.
|
135 |
+
|
136 |
+
Caption to phrase grounding results format:
|
137 |
+
{'\<CAPTION_TO_PHRASE_GROUNDING>': {'bboxes': [[x1, y1, x2, y2], ...], 'labels': ['', '', ...]}}
|
138 |
+
```python
|
139 |
+
task_prompt = "<CAPTION_TO_PHRASE_GROUNDING>"
|
140 |
+
results = run_example(task_prompt, text_input="A green car parked in front of a yellow building.")
|
141 |
+
```
|
142 |
+
|
143 |
### Object Detection
|
144 |
|
145 |
OD results format:
|
|
|
169 |
run_example(prompt)
|
170 |
```
|
171 |
|
|
|
|
|
172 |
|
173 |
+
### OCR
|
174 |
+
|
175 |
```python
|
176 |
+
prompt = "<OCR>"
|
177 |
+
run_example(prompt)
|
178 |
+
```
|
179 |
+
|
180 |
+
### OCR with Region
|
181 |
+
OCR with region output format:
|
182 |
+
{'\<OCR_WITH_REGION>': {'quad_boxes': [[x1, y1, x2, y2, x3, y3, x4, y4], ...], 'labels': ['text1', ...]}}
|
183 |
+
```python
|
184 |
+
prompt = "<OCR_WITH_REGION>"
|
185 |
+
run_example(prompt)
|
186 |
```
|
187 |
|
188 |
for More detailed examples, please refer to [notebook](https://huggingface.co/microsoft/Florence-2-large/blob/main/sample_inference.ipynb)
|