Update README.md
Browse files
README.md
CHANGED
|
@@ -70,6 +70,9 @@ This model is capable of performing different tasks through changing the prompts
|
|
| 70 |
|
| 71 |
First, let's define a function to run a prompt.
|
| 72 |
|
|
|
|
|
|
|
|
|
|
| 73 |
```python
|
| 74 |
import requests
|
| 75 |
|
|
@@ -103,6 +106,7 @@ def run_example(prompt):
|
|
| 103 |
print(entities)
|
| 104 |
print(_processed_text)
|
| 105 |
```
|
|
|
|
| 106 |
|
| 107 |
Here are the tasks `Kosmos-2` could perform:
|
| 108 |
|
|
@@ -197,6 +201,9 @@ run_example(prompt)
|
|
| 197 |
|
| 198 |
Once you have the `entities`, you can use the following helper function to draw their bounding bboxes on the image:
|
| 199 |
|
|
|
|
|
|
|
|
|
|
| 200 |
```python
|
| 201 |
import cv2
|
| 202 |
import numpy as np
|
|
@@ -329,6 +336,7 @@ entities = [('a snowman', (12, 21), [(0.390625, 0.046875, 0.984375, 0.828125)]),
|
|
| 329 |
# Draw the bounding bboxes
|
| 330 |
draw_entity_boxes_on_image(image, entities, show=True)
|
| 331 |
```
|
|
|
|
| 332 |
|
| 333 |
Here is the annotated image:
|
| 334 |
|
|
|
|
| 70 |
|
| 71 |
First, let's define a function to run a prompt.
|
| 72 |
|
| 73 |
+
<details>
|
| 74 |
+
<summary> Click to expand </summary>
|
| 75 |
+
|
| 76 |
```python
|
| 77 |
import requests
|
| 78 |
|
|
|
|
| 106 |
print(entities)
|
| 107 |
print(_processed_text)
|
| 108 |
```
|
| 109 |
+
</details>
|
| 110 |
|
| 111 |
Here are the tasks `Kosmos-2` could perform:
|
| 112 |
|
|
|
|
| 201 |
|
| 202 |
Once you have the `entities`, you can use the following helper function to draw their bounding bboxes on the image:
|
| 203 |
|
| 204 |
+
<details>
|
| 205 |
+
<summary> Click to expand </summary>
|
| 206 |
+
|
| 207 |
```python
|
| 208 |
import cv2
|
| 209 |
import numpy as np
|
|
|
|
| 336 |
# Draw the bounding bboxes
|
| 337 |
draw_entity_boxes_on_image(image, entities, show=True)
|
| 338 |
```
|
| 339 |
+
</details>
|
| 340 |
|
| 341 |
Here is the annotated image:
|
| 342 |
|