Update README.md
Browse files
README.md
CHANGED
|
@@ -11,14 +11,19 @@ DISBench is the first benchmark for context-aware image retrieval over visual hi
|
|
| 11 |
|
| 12 |
## Download
|
| 13 |
|
|
|
|
|
|
|
| 14 |
```bash
|
| 15 |
-
|
| 16 |
-
|
| 17 |
|
| 18 |
-
|
|
|
|
|
|
|
| 19 |
python download_images.py --photo-ids-path photo_ids --images-path images
|
| 20 |
```
|
| 21 |
|
|
|
|
| 22 |
## File Structure
|
| 23 |
|
| 24 |
```
|
|
@@ -31,7 +36,6 @@ DISBench/
|
|
| 31 |
│ └── {photo_id}.jpg # Photo files
|
| 32 |
├── photo_ids/
|
| 33 |
│ └── {user_id}.txt # Photo IDs and hashes per user
|
| 34 |
-
├── evaluate.py # Evaluation script
|
| 35 |
└── download_images.py # Image download script
|
| 36 |
```
|
| 37 |
|
|
@@ -43,10 +47,10 @@ Each line is a JSON object representing one query:
|
|
| 43 |
|
| 44 |
```json
|
| 45 |
{
|
| 46 |
-
"query_id": "
|
| 47 |
-
"user_id": "
|
| 48 |
"query": "Find photos from the musical performance identified by the blue and white event logo on site, where only the lead singer appears on stage.",
|
| 49 |
-
"answer": ["
|
| 50 |
"event_type": "intra-event"
|
| 51 |
}
|
| 52 |
```
|
|
@@ -65,14 +69,14 @@ Each line is a JSON object representing one photo's metadata:
|
|
| 65 |
|
| 66 |
```json
|
| 67 |
{
|
| 68 |
-
"photo_id": "
|
| 69 |
"metadata": {
|
| 70 |
-
"taken_time": "
|
| 71 |
-
"longitude": -1.
|
| 72 |
-
"latitude":
|
| 73 |
"accuracy": 16.0,
|
| 74 |
-
"address": "
|
| 75 |
-
"capturedevice": "
|
| 76 |
}
|
| 77 |
}
|
| 78 |
```
|
|
@@ -105,119 +109,6 @@ Each line represents one photo ID and its hash on aws storage in the format `{ph
|
|
| 105 |
| `photo_id` | string | Unique photo identifier |
|
| 106 |
| `hash` | string | Hashed value of the photo on aws storage |
|
| 107 |
|
| 108 |
-
## Evaluation
|
| 109 |
-
|
| 110 |
-
### Agent Evaluation
|
| 111 |
-
|
| 112 |
-
For agent systems that predict a set of photo IDs per query:
|
| 113 |
-
|
| 114 |
-
```bash
|
| 115 |
-
python evaluate.py \
|
| 116 |
-
--mode agent \
|
| 117 |
-
--dataset_path . \
|
| 118 |
-
--prediction_path /path/to/predictions.jsonl \
|
| 119 |
-
--output_dir /path/to/run_id_dir/
|
| 120 |
-
```
|
| 121 |
-
|
| 122 |
-
**Prediction format** — a JSONL file where each line is:
|
| 123 |
-
|
| 124 |
-
```json
|
| 125 |
-
{
|
| 126 |
-
"query_id": "q001",
|
| 127 |
-
"prediction": ["98765432", "98765433"]
|
| 128 |
-
}
|
| 129 |
-
```
|
| 130 |
-
|
| 131 |
-
**Output files:**
|
| 132 |
-
|
| 133 |
-
`eval_samples.jsonl` — per-query results:
|
| 134 |
-
|
| 135 |
-
```json
|
| 136 |
-
{
|
| 137 |
-
"query_id": "q001",
|
| 138 |
-
"user_id": "12345678",
|
| 139 |
-
"query": "Find photos from the musical performance...",
|
| 140 |
-
"answer": ["98765432", "98765433", "98765434"],
|
| 141 |
-
"prediction": ["98765432", "98765433"],
|
| 142 |
-
"tp": 2, "fp": 0, "fn": 1,
|
| 143 |
-
"em": 0,
|
| 144 |
-
"iou": 0.667,
|
| 145 |
-
"precision": 1.0,
|
| 146 |
-
"recall": 0.667,
|
| 147 |
-
"f1": 0.8
|
| 148 |
-
}
|
| 149 |
-
```
|
| 150 |
-
|
| 151 |
-
`eval_summary.json` — aggregated results:
|
| 152 |
-
|
| 153 |
-
```json
|
| 154 |
-
{
|
| 155 |
-
"n_samples": {
|
| 156 |
-
"total": 122,
|
| 157 |
-
"inter_event": 65,
|
| 158 |
-
"intra_event": 57
|
| 159 |
-
},
|
| 160 |
-
"aggregation": {
|
| 161 |
-
"total": {
|
| 162 |
-
"macro": { "em": 0.271, "iou": 0.45, "precision": 0.55, "recall": 0.52, "f1": 0.513 },
|
| 163 |
-
"micro": { "tp": 230, "fp": 45, "fn": 60, "iou": 0.42, "precision": 0.836, "recall": 0.793, "f1": 0.814 }
|
| 164 |
-
},
|
| 165 |
-
"inter_event": { "macro": { "..." : "..." }, "micro": { "..." : "..." } },
|
| 166 |
-
"intra_event": { "macro": { "..." : "..." }, "micro": { "..." : "..." } }
|
| 167 |
-
},
|
| 168 |
-
"set_size": {
|
| 169 |
-
"avg_answer_size": { "total": 3.76, "inter_event": 3.52, "intra_event": 4.04 },
|
| 170 |
-
"avg_pred_size": { "total": 3.10, "inter_event": 2.80, "intra_event": 3.44 }
|
| 171 |
-
},
|
| 172 |
-
"notes": {
|
| 173 |
-
"empty_pred_count": { "total": 5, "inter_event": 3, "intra_event": 2 }
|
| 174 |
-
}
|
| 175 |
-
}
|
| 176 |
-
```
|
| 177 |
-
|
| 178 |
-
### Retriever Baseline Evaluation
|
| 179 |
-
|
| 180 |
-
For embedding-based retrieval that returns a ranked list:
|
| 181 |
-
|
| 182 |
-
```bash
|
| 183 |
-
python evaluate.py \
|
| 184 |
-
--mode retriever \
|
| 185 |
-
--dataset_path . \
|
| 186 |
-
--prediction_path /path/to/predictions.jsonl \
|
| 187 |
-
--output_dir /path/to/retriever_dir/
|
| 188 |
-
```
|
| 189 |
-
|
| 190 |
-
**Prediction format** — a JSONL file where each line is:
|
| 191 |
-
|
| 192 |
-
```json
|
| 193 |
-
{
|
| 194 |
-
"query_id": "q001",
|
| 195 |
-
"prediction": ["photo_rank1", "photo_rank2", "photo_rank3", "..."]
|
| 196 |
-
}
|
| 197 |
-
```
|
| 198 |
-
|
| 199 |
-
> Predictions should be ordered by descending relevance score.
|
| 200 |
-
|
| 201 |
-
**Output files:**
|
| 202 |
-
|
| 203 |
-
`eval_samples.jsonl` — per-query results with MAP@k, Recall@k, NDCG@k for k ∈ {1, 3, 5, 10}.
|
| 204 |
-
|
| 205 |
-
`eval_summary.json` — aggregated metrics:
|
| 206 |
-
|
| 207 |
-
```json
|
| 208 |
-
{
|
| 209 |
-
"n_samples": 122,
|
| 210 |
-
"aggregation": {
|
| 211 |
-
"MAP@1": 0.123, "MAP@3": 0.105, "MAP@5": 0.120, "MAP@10": 0.133,
|
| 212 |
-
"Recall@1": 0.054, "Recall@3": 0.116, "Recall@5": 0.170, "Recall@10": 0.250,
|
| 213 |
-
"NDCG@1": 0.123, "NDCG@3": 0.133, "NDCG@5": 0.157, "NDCG@10": 0.188
|
| 214 |
-
},
|
| 215 |
-
"notes": {
|
| 216 |
-
"incomplete_pred_count": 0
|
| 217 |
-
}
|
| 218 |
-
}
|
| 219 |
-
```
|
| 220 |
-
|
| 221 |
## Dataset Statistics
|
| 222 |
|
| 223 |
| Statistic | Value |
|
|
@@ -227,7 +118,7 @@ python evaluate.py \
|
|
| 227 |
| Inter-Event Queries | 65 (53.3%) |
|
| 228 |
| Total Users | 57 |
|
| 229 |
| Total Photos | 109,467 |
|
| 230 |
-
| Avg. Targets per Query | 3.
|
| 231 |
| Avg. History Span | 3.4 years |
|
| 232 |
| Query Retention Rate | 6.1% (122 / 2,000 candidates) |
|
| 233 |
| Inter-Annotator IoU | 0.91 |
|
|
|
|
| 11 |
|
| 12 |
## Download
|
| 13 |
|
| 14 |
+
**Option A: Hugging Face (Recommended)**
|
| 15 |
+
|
| 16 |
```bash
|
| 17 |
+
huggingface-cli download RUC-NLPIR/DISBench --local-dir DISBench
|
| 18 |
+
```
|
| 19 |
|
| 20 |
+
**Option B: Manual Download**
|
| 21 |
+
|
| 22 |
+
```bash
|
| 23 |
python download_images.py --photo-ids-path photo_ids --images-path images
|
| 24 |
```
|
| 25 |
|
| 26 |
+
|
| 27 |
## File Structure
|
| 28 |
|
| 29 |
```
|
|
|
|
| 36 |
│ └── {photo_id}.jpg # Photo files
|
| 37 |
├── photo_ids/
|
| 38 |
│ └── {user_id}.txt # Photo IDs and hashes per user
|
|
|
|
| 39 |
└── download_images.py # Image download script
|
| 40 |
```
|
| 41 |
|
|
|
|
| 47 |
|
| 48 |
```json
|
| 49 |
{
|
| 50 |
+
"query_id": "1",
|
| 51 |
+
"user_id": "10287726@N02",
|
| 52 |
"query": "Find photos from the musical performance identified by the blue and white event logo on site, where only the lead singer appears on stage.",
|
| 53 |
+
"answer": ["7759256930", "7759407170", "7759295108", "7759433016"],
|
| 54 |
"event_type": "intra-event"
|
| 55 |
}
|
| 56 |
```
|
|
|
|
| 69 |
|
| 70 |
```json
|
| 71 |
{
|
| 72 |
+
"photo_id": "4517621778",
|
| 73 |
"metadata": {
|
| 74 |
+
"taken_time": "2010-04-10 13:52:57",
|
| 75 |
+
"longitude": -1.239802,
|
| 76 |
+
"latitude": 51.754123,
|
| 77 |
"accuracy": 16.0,
|
| 78 |
+
"address": "Y, Cherwell Street, St Clement's, East Oxford, Oxford, Oxfordshire, England, OX4 1BQ, United Kingdom",
|
| 79 |
+
"capturedevice": "Panasonic DMC-TZ5"
|
| 80 |
}
|
| 81 |
}
|
| 82 |
```
|
|
|
|
| 109 |
| `photo_id` | string | Unique photo identifier |
|
| 110 |
| `hash` | string | Hashed value of the photo on aws storage |
|
| 111 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 112 |
## Dataset Statistics
|
| 113 |
|
| 114 |
| Statistic | Value |
|
|
|
|
| 118 |
| Inter-Event Queries | 65 (53.3%) |
|
| 119 |
| Total Users | 57 |
|
| 120 |
| Total Photos | 109,467 |
|
| 121 |
+
| Avg. Targets per Query | 3.84 |
|
| 122 |
| Avg. History Span | 3.4 years |
|
| 123 |
| Query Retention Rate | 6.1% (122 / 2,000 candidates) |
|
| 124 |
| Inter-Annotator IoU | 0.91 |
|