Update README.md
Browse files
README.md
CHANGED
|
@@ -24,13 +24,15 @@ Each example contains:
|
|
| 24 |
- `filename` (`string`): The original filename of the image (e.g., `200000.jpg`).
|
| 25 |
- `split_type` (`string`): The type of split the image belongs to (`original` or `strong`).
|
| 26 |
- `block_id` (`int32`): The first 4 digits of the filename, representing the block ID (e.g., `2000` for `200000.jpg`).
|
| 27 |
-
- `query_id` (`int32`): The query ID for query images (-1 for database images).
|
| 28 |
|
| 29 |
## Dataset Splits
|
| 30 |
|
| 31 |
-
- **queries**: Query images with modifications for evaluation.
|
| 32 |
- **database**: Original images used as the database for retrieval.
|
| 33 |
|
|
|
|
|
|
|
| 34 |
## Dataset Versions
|
| 35 |
|
| 36 |
- Version 1.0.0
|
|
@@ -42,32 +44,33 @@ Use the Hugging Face `datasets` library to load one of the configs:
|
|
| 42 |
```python
|
| 43 |
import datasets
|
| 44 |
|
| 45 |
-
#
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
# Load query
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
|
|
|
| 71 |
```
|
| 72 |
|
| 73 |
## Dataset Structure
|
|
|
|
| 24 |
- `filename` (`string`): The original filename of the image (e.g., `200000.jpg`).
|
| 25 |
- `split_type` (`string`): The type of split the image belongs to (`original` or `strong`).
|
| 26 |
- `block_id` (`int32`): The first 4 digits of the filename, representing the block ID (e.g., `2000` for `200000.jpg`).
|
| 27 |
+
- `query_id` (`int32`): The query ID for query images (-1 for database images). Digits 5 and 6 of an image name (e.g., `01` for `200001.jpg`).
|
| 28 |
|
| 29 |
## Dataset Splits
|
| 30 |
|
| 31 |
+
- **queries**: Query images with modifications for evaluation. Also includes the original images.
|
| 32 |
- **database**: Original images used as the database for retrieval.
|
| 33 |
|
| 34 |
+
To tell if something is an original image, refer to a given images `split_type` field.
|
| 35 |
+
|
| 36 |
## Dataset Versions
|
| 37 |
|
| 38 |
- Version 1.0.0
|
|
|
|
| 44 |
```python
|
| 45 |
import datasets
|
| 46 |
|
| 47 |
+
# Name of the dataset
|
| 48 |
+
dataset_name = "randall-lab/INRIA-CopyDays"
|
| 49 |
+
|
| 50 |
+
# Load query images
|
| 51 |
+
query_dataset = datasets.load_dataset(
|
| 52 |
+
dataset_name,
|
| 53 |
+
split="queries",
|
| 54 |
+
trust_remote_code=True,
|
| 55 |
+
)
|
| 56 |
+
|
| 57 |
+
# Load database images
|
| 58 |
+
db_dataset = datasets.load_dataset(
|
| 59 |
+
dataset_name,
|
| 60 |
+
split="database",
|
| 61 |
+
trust_remote_code=True,
|
| 62 |
+
)
|
| 63 |
+
|
| 64 |
+
# Print the length of the query dataset -- should be 386, since it includes all 229 strong AND all 157 original queries
|
| 65 |
+
print(f"Number of query images: {len(query_dataset)}")
|
| 66 |
+
|
| 67 |
+
# You can tell if it is a strong or an original query by checking the `split_type` field on a given image
|
| 68 |
+
example_query = query_dataset[0] # Get any desired query image
|
| 69 |
+
print(f"Example Query - Filename: {example_query['filename']}")
|
| 70 |
+
print(f"Example Query - Split Type: {example_query['split_type']}")
|
| 71 |
+
|
| 72 |
+
# Print the length of the database dataset -- should be 157, since it includes all 157 original images
|
| 73 |
+
print(f"Number of database images: {len(db_dataset)}")
|
| 74 |
```
|
| 75 |
|
| 76 |
## Dataset Structure
|