Update README.md
Browse files32 unmodified lines3334353637383940414243444546474849505152535455565357585955606162634 unmodified lines68697066717273747 unmodified lines828384858687882 unmodified lines919293949596978 unmodified lines1061071081021091101111051061071121091101111131141151161179 unmodified lines1271281291301311321335 unmodified lines1391401411421431441456 unmodified lines15215315415515615715820 unmodified lines1791801811761821831841851861871881899 unmodified lines19920020120220320420521 unmodified lines22722822923023123223323423523623723823924042 unmodified lines28328428528628728828929029129229329429529629728529829930030135 unmodified lines3373383393273403413423431 unmodified line3453463473483493503517 unmodified lines3593603613483493503513523533543553563573583593603613623633643623633643653663673683693703713723733743753763773783793803663813823683693703713723833843853863873883743753763773783793803893903913923933943953963823833843853863873973983994004014024034044052 unmodified lines40840941041141241341415 unmodified lines43043143243343443543611 unmodified lines44844945043445145245345445545645744144244344444544644744844945045145245345445545645845946046146246346446546646746846947047147247347447547647747847948046048148248348448548648748848949049149249349449549649749849950050150250350450550650746246346446546650850951051151251351451551651732 unmodified lines path: data/location-* - split: placement path: data/placement-*
---
<!-- New benchmark release announcement -->
<div style="background-color: #ecfdf5; border-left: 4px solid #10b981; padding: 0.75em 1em; margin-top: 1em; color: #065f46; font-weight: bold; border-radius: 0.375em;"> π This repository contains the new version of <strong>RefSpatial-Bench</strong> β <strong>RefSpatial-Expand-Bench</strong>!<br> Based on the original benchmark, the new version <strong>extends indoor scenes</strong> (e.g., factories, stores) and adds <strong>previously uncovered outdoor scenarios</strong> (e.g., streets, parking lots), providing a more comprehensive evaluation of spatial referring tasks.</div>
<div style="background-color: #fef3c7; border-left: 4px solid #f59e0b; padding: 0.75em 1em; margin-top: 1em; color: #78350f; font-weight: bold; border-radius: 0.375em;"> π The paper associated with this benchmark, <strong>RoboRefer</strong>, has been accepted to <strong>NeurIPS 2025</strong>!<br> Thank you all for your attention and support! π</div>
<h1 style="display: flex; align-items: center; justify-content: center; font-size: 1.75em; font-weight: 600;">
<img src="https://huggingface.co/datasets/BAAI/RefSpatial-Bench/resolve/main/assets/logo.png" style="height: 60px; flex-shrink: 0;">
<span style="line-height: 1.2; margin-left: 0px; text-align: center;"> RefSpatial-Bench: A Benchmark for Multi-step Spatial Referring </span>4 unmodified lines<!-- # RefSpatial-Bench: A Benchmark for Multi-step Spatial Referring with Reasoning -->
<!-- [](https://huggingface.co/datasets/BAAI/RefSpatial-Bench) -->
<p align="center"> <a href="https://zhoues.github.io/RoboRefer"><img src="https://img.shields.io/badge/%F0%9F%8F%A0%20Project-Homepage-blue" alt="HomePage"></a> 7 unmodified lines</p>
Welcome to **RefSpatial-Bench**, a challenging benchmark based on real-world cluttered scenes to evaluate more complex multi-step spatial referring with reasoning.
<img src="https://api.visitorbadge.io/api/combined?path=https%3A%2F%2Fzhoues.github.io&labelColor=%232ccce4&countColor=%230158f9" alt="visitor badge" style="display: none;" />2 unmodified lines
<!-- ## π Table of Contents
* [π― Tasks](#π―-tasks)* [π§ Reasoning Steps](#π§ -reasoning-steps)* [π Dataset Structure](#π-dataset-structure)8 unmodified lines* [π Dataset Statistics](#π-dataset-statistics)* [π Performance Highlights](#π-performance-highlights)* [π Citation](#π-citation)--- --> --- -->
## π― Task Split- Location Task: This task contains **100** samples, which requires model to predicts a 2D point indicating the **unique target object**.
- Placement Task: This task contains **100** samples, which requires model to predicts a 2D point within the **desired free space**.
- Unseen Set: This set comprises **77** samples from the Location/Placement task, specifically designed to **evaluate model generalization after SFT/RFT training on RefSpatial**, as it includes novel spatial relation combinations not present in RefSpatial.
<div style="background-color: #ffe4e6; border-left: 4px solid #dc2626; padding: 0.75em 1em; margin-top: 1em; color: #b91c1c; font-weight: bold; border-radius: 0.375em;"> β οΈ Warning: If your model is not trained with RefSpatial, Unseen set should not be used for evaluation. </div>- Location Task: This task contains **241** samples, which requires model to predicts a 2D point indicating the **unique target object**.- Placement Task: This task contains **200** samples, which requires model to predicts a 2D point within the **desired free space**.
## π§ Reasoning Steps9 unmodified lines<details><summary><strong>Hugging Face Datasets Format</strong></summary>
`data/` folder contains HF-compatible splits:
* `location`5 unmodified lines| Field | Description || :------- | :----------------------------------------------------------- || `id` | Unique integer ID || scene | indoor or outdoor || `object` | Natural language description of target (object or free area), which is extracted from the `prompt` || `prompt` | Full Referring expressions || `suffix` | Instruction for answer formatting (**different models may use different suffixes or none**; we provide the format used by RoboRefer) |6 unmodified lines<details><summary><strong>Raw Data Format</strong></summary>
For full reproducibility and visualization, we also include the original files under:
* `Location/`20 unmodified lines "rgb_path": "image/40.png", "mask_path": "mask/40.png", "category": "location", "step": 2 "step": 2, "scene": indoor}```
</details>
9 unmodified lines<details><summary><strong>Method 1: Using Hugging Face Library</strong></summary>
You can load the dataset easily using the `datasets` library:
```python21 unmodified linesprint(f"Suffix (from HF Dataset): {sample['suffix']}")print(f"Reasoning Steps (from HF Dataset): {sample['step']}")```
</details>
<details><summary><strong>Method 2: Using Raw Data Files (JSON and Images)</strong></summary>
If you are working with the raw data format (e.g., after cloning the repository or downloading the raw files), you can load the questions from the `question.json` file for each split and then load the images and masks using a library like Pillow (PIL).
This example assumes you have the `location`, `placement`, and `unseen` folders (each containing `image/`, `mask/`, and `question.json`) in a known `base_data_path`.42 unmodified lineselse: print("No samples loaded.")```
</details>
<details><summary><strong>Evaluating RoboRefer / RoboPoint</strong></summary>
To evaluate RoboRefer on RefSpatial-Bench:
1. **Prepare Input Prompt:**
Concatenate `sample["prompt"]` and `sample["suffix"]` to form the complete instruction. Concatenate `sample["prompt"]` and `sample["suffix"]` to form the complete instruction.
```python # Example for constructing the full input for a sample35 unmodified lines # These scaled_roborefer_points are then used for evaluation against the mask. ```
4. **Evaluation:** Compare `scaled_roborefer_points` against `sample["mask"]`. The main metric is **average success rate** β the percentage of predictions falling within the mask.3. **Evaluation:** Compare `scaled_roborefer_points` against `sample["mask"]`. The main metric is **average success rate** β the percentage of predictions falling within the mask.
</details>
1 unmodified line<summary><strong>Evaluating Gemini Series</strong></summary>
To evaluate Gemini Series on RefSpatial-Bench:
1. **Prepare Input Prompt:** 7 unmodified lines
2. **Model Prediction & JSON Parsing & Coordinate Scaling:**
* **Model Prediction:** After providing the image (`sample["image"]`) and `full_input_instruction` to the Gemini model series, it outputs **normalized coordinates in an JSON format** like `"```json\n[\n {\"point\": [y, x], \"label\": \"free space\"}, ...\n]\n```"`, where each `y` and `x` value is normalized to a range of 0-1000.
* **JSON Parsing:** Parse this JSON string to extract the coordinate attributes (e.g., `x1`, `y1`, `x2`, `y2`, etc.).
* **Coordinate Conversion:** To use these coordinates for evaluation against the mask, they must be: 1. Divided by 1000.0 to normalize them to the 0.0-1.0 range. 2. Scaled to the original image dimensions (height for y, width for x). ```python # Example: model_output_gemini is "```json\n[\n {\"point\": [438, 330], \"label\": \"free space\"}\n]\n```" from Gemini # and sample["image"] is a PIL Image object loaded by the datasets library or loaded from the raw data def json2pts(text, width, height): match = re.search(r"```(?:\w+)?\n(.*?)```", text, re.DOTALL) if not match: print("No valid code block found.") return np.empty((0, 2), dtype=int) * **Model Prediction:** After providing the image (`sample["image"]`) and `full_input_instruction` to the Gemini model series, it outputs **normalized coordinates in an JSON format** like `"```json\n[\n {\"point\": [y, x], \"label\": \"free space\"}, ...\n]\n```"`, where each `y` and `x` value is normalized to a range of 0-1000.
* **JSON Parsing:** Parse this JSON string to extract the coordinate attributes (e.g., `x1`, `y1`, `x2`, `y2`, etc.).
* **Coordinate Conversion:** To use these coordinates for evaluation against the mask, they must be:
1. Divided by 1000.0 to normalize them to the 0.0-1.0 range. 2. Scaled to the original image dimensions (height for y, width for x).
```python # Example: model_output_gemini is "```json\n[\n {\"point\": [438, 330], \"label\": \"free space\"}\n]\n```" from Gemini # and sample["image"] is a PIL Image object loaded by the datasets library or loaded from the raw data def json2pts(text, width, height): match = re.search(r"```(?:\w+)?\n(.*?)```", text, re.DOTALL) if not match: print("No valid code block found.") return np.empty((0, 2), dtype=int) json_cleaned = match.group(1).strip() json_cleaned = match.group(1).strip() try: data = json.loads(json_cleaned) except json.JSONDecodeError as e: print(f"JSON decode error: {e}") return np.empty((0, 2), dtype=int) try: data = json.loads(json_cleaned) except json.JSONDecodeError as e: print(f"JSON decode error: {e}") return np.empty((0, 2), dtype=int) points = [] for item in data: if "point" in item and isinstance(item["point"], list) and len(item["point"]) == 2: y_norm, x_norm = item["point"] x = int(x_norm / 1000 * width) y = int(y_norm / 1000 * height) points.append((x, y)) points = [] for item in data: if "point" in item and isinstance(item["point"], list) and len(item["point"]) == 2: y_norm, x_norm = item["point"] x = int(x_norm / 1000 * width) y = int(y_norm / 1000 * height) points.append((x, y)) return np.array(points) width, height = sample["image"].size scaled_gemini_points = json2pts(model_output_gemini, width, height) # These scaled_gemini_points are then used for evaluation against the mask. ``` return np.array(points) width, height = sample["image"].size scaled_gemini_points = json2pts(model_output_gemini, width, height) # These scaled_gemini_points are then used for evaluation against the mask. ```
3. **Evaluation:** Compare `scaled_gemini_points` against `sample["mask"]`. The main metric is **average success rate** β the percentage of predictions falling within the mask.
2 unmodified lines<details><summary><strong>Evaluating the Molmo</strong></summary>
To evaluate a Molmo model on this benchmark:
1. **Prepare Input Prompt:** 15 unmodified lines
1. Divide each coordinate by 100.0 to normalize it to the 0.0-1.0 range. 2. Scaled to the original image dimensions (height for y, width for x).
```python # Example: model_output_molmo is '<points x1="61.5" y1="40.4" x2="76.8" y2="21.8"/>' from Molmo # and sample["image"] is a PIL Image object loaded by the datasets library or loaded from the raw data11 unmodified lines ```
3. **Evaluation:** Compare `scaled_molmo_points` against `sample["mask"]`. The main metric is **average success rate** β the percentage of predictions falling within the mask.</details> </details>
## π Dataset Statistics
Detailed statistics on `step` distributions and instruction lengths are provided in the table below.
| **RefSpatial-Bench** | **Step / Statistic** | **Samples** | **Avg. Prompt Length** || :------------------- | :------------------- | :---------- | :--------------------- || **Location** | Step 1 | 30 | 11.13 || | Step 2 | 38 | 11.97 || | Step 3 | 32 | 15.28 || | **Avg. (All)** | **100** | 12.78 || **Placement** | Step 2 | 43 | 15.47 || | Step 3 | 28 | 16.07 || | Step 4 | 22 | 22.68 || | Step 5 | 7 | 22.71 || | **Avg. (All)** | **100** | 17.68 || **Unseen** | Step 2 | 29 | 17.41 || | Step 3 | 26 | 17.46 || | Step 4 | 17 | 24.71 || | Step 5 | 5 | 23.8 || | **Avg. (All)** | **77** | 19.45 || Task Type | Indoor | Outdoor | Total || --------- | ------- | ------- | ------- || Location | 115 | 126 | 241 || Placement | 120 | 80 | 200 || **Total** | **235** | **206** | **441** |
| Task Type | Step | Samples | Avg. Prompt Length || --------- | -------------- | ------- | ------------------ || Location | Step 1 | 54 | 10.61 || | Step 2 | 129 | 12.56 || | Step 3 | 58 | 16.10 || | **Avg. (All)** | **241** | **12.98** || Placement | Step 1 | 3 | 15.00 || | Step 2 | 86 | 15.14 || | Step 3 | 75 | 16.95 || | Step 4 | 29 | 22.24 || | Step 5 | 7 | 22.71 || | **Avg. (All)** | **200** | **17.11** |
## π Performance Highlights
As our research shows, **RefSpatial-Bench** presents a significant challenge to current models. In the table below, bold text indicates Top-1 accuracy, and underline text indicates Top-2 accuracy.Detailed accuracy results of RoboRefer-2B-SFT and RoboRefer-8B-SFT Models on RefSpatial-Bench-Expand
#### **Location Task**
| Category | 2B SFT | 8B SFT || -------- | ------ | ------ || Overall | 50.21 | 61.00 || Indoor | 49.57 | 58.26 || Outdoor | 50.79 | 63.49 || Step 1 | 61.11 | 72.22 || Step 2 | 52.71 | 62.02 || Step 3 | 34.48 | 48.28 |
#### **Placement Task**
| Category | 2B SFT | 8B SFT || -------- | ------ | ------ || Overall | 48.50 | 60.00 || Indoor | 50.83 | 60.00 || Outdoor | 45.00 | 60.00 || Step 1 | 33.33 | 33.33 || Step 2 | 41.86 | 51.16 || Step 3 | 54.67 | 70.67 || Step 4 | 48.28 | 55.17 || Step 5 | 71.43 | 85.71 |
| **Benchmark** | **Gemini-2.5-Pro** | **SpaceLLaVA** | **RoboPoint** | **Molmo-7B** | **Molmo-72B** | **RoboRefer 2B-SFT** | **RoboRefer 8B-SFT** | **RoboRefer 2B-RFT** || :----------------: | :----------------: | :------------: | :-----------: | :----------: | :-----------: | :------------: | :------------: | :------------: || RefSpatial-Bench-L | 46.96 | 5.82 | 22.87 | 21.91 | 45.77 | <u>47.00</u> | **52.00** | **52.00** || RefSpatial-Bench-P | 24.21 | 4.31 | 9.27 | 12.85 | 14.74 | 48.00 | <u>53.00</u> | **54.00** || RefSpatial-Bench-U | 27.14 | 4.02 | 8.40 | 12.23 | 21.24 | 33.77 | <u>37.66</u> | **41.56** |
## π« Contact
If you have any questions about the benchmark, feel free to email Jingkun (anjingkun02@gmail.com) and Enshen (zhouenshen@buaa.edu.cn).<img src="https://api.visitorbadge.io/api/combined?path=https%3A%2F%2Fzhoues.github.io&labelColor=%232ccce4&countColor=%230158f9" alt="visitor badge" style="display: none;" /><img src="https://api.visitorbadge.io/api/combined?path=https%3A%2F%2Fanjingkun.github.io&labelColor=%232ccce4&countColor=%230158f9" alt="visitor badge" style="display: none;" />
## π Citation
Please consider citing our work if this benchmark is useful for your research.README.md+114-72