ianhajra commited on
Commit
bbf67b6
·
verified ·
1 Parent(s): 54271be

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +31 -28
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
- # These are the config names defined in the script
46
- dataset_configs = ["database", "query"]
47
-
48
- # Load query split for evaluation
49
- for i, config_name in enumerate(dataset_configs, start=1):
50
- # Load query images
51
- query_dataset = datasets.load_dataset(
52
- path="copydays.py", # use local dataset script
53
- name=config_name,
54
- split="queries",
55
- trust_remote_code=True,
56
- )
57
-
58
- # Load database images
59
- db_dataset = datasets.load_dataset(
60
- path="copydays.py", # use local dataset script
61
- name=config_name,
62
- split="database",
63
- trust_remote_code=True,
64
- )
65
-
66
- print(f"[{i}] Loaded config '{config_name}' - queries: {len(query_dataset)}, database: {len(db_dataset)}")
67
-
68
- # Example query
69
- query_example = query_dataset[0]
70
- print(f"Query: {query_example['filename']}, Block ID: {query_example['block_id']}, Query ID: {query_example['query_id']}")
 
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