Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -59,7 +59,7 @@ Each line of `test/metadata.jsonl` describes one target. In addition to the quer
|
|
| 59 |
| `ei_answer` | string | Reference reasoning answer for the EI query. |
|
| 60 |
| `ii_answer` | string | Reference reasoning answer for the II query. |
|
| 61 |
|
| 62 |
-
## Reading
|
| 63 |
|
| 64 |
```text
|
| 65 |
RSReasoner-Bench/
|
|
@@ -71,7 +71,7 @@ RSReasoner-Bench/
|
|
| 71 |
└── ...
|
| 72 |
```
|
| 73 |
|
| 74 |
-
The following example reads one JSONL record and loads its image
|
| 75 |
|
| 76 |
```python
|
| 77 |
import json
|
|
@@ -94,6 +94,9 @@ mask = mask_utils.decode({
|
|
| 94 |
"counts": rle["counts"].encode("ascii"),
|
| 95 |
}) # 1 = target, 0 = background
|
| 96 |
|
|
|
|
|
|
|
| 97 |
print(sample["id"], sample["ei_query"])
|
| 98 |
print(image.size, mask.shape) # (448, 448), (448, 448)
|
|
|
|
| 99 |
```
|
|
|
|
| 59 |
| `ei_answer` | string | Reference reasoning answer for the EI query. |
|
| 60 |
| `ii_answer` | string | Reference reasoning answer for the II query. |
|
| 61 |
|
| 62 |
+
## Reading a target
|
| 63 |
|
| 64 |
```text
|
| 65 |
RSReasoner-Bench/
|
|
|
|
| 71 |
└── ...
|
| 72 |
```
|
| 73 |
|
| 74 |
+
The following example reads one JSONL record and loads its image, segmentation mask, and bounding box. Set `root` to your local dataset directory. Image and mask loading requires `Pillow` and `pycocotools`.
|
| 75 |
|
| 76 |
```python
|
| 77 |
import json
|
|
|
|
| 94 |
"counts": rle["counts"].encode("ascii"),
|
| 95 |
}) # 1 = target, 0 = background
|
| 96 |
|
| 97 |
+
bbox = sample["bbox"] # [x, y, width, height] in pixels
|
| 98 |
+
|
| 99 |
print(sample["id"], sample["ei_query"])
|
| 100 |
print(image.size, mask.shape) # (448, 448), (448, 448)
|
| 101 |
+
print(bbox)
|
| 102 |
```
|