PAGF commited on
Commit
30cec39
·
verified ·
0 Parent(s):

Super-squash branch 'main' using huggingface_hub

Browse files
.gitattributes ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.lz4 filter=lfs diff=lfs merge=lfs -text
12
+ *.mds filter=lfs diff=lfs merge=lfs -text
13
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
14
+ *.model filter=lfs diff=lfs merge=lfs -text
15
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
16
+ *.npy filter=lfs diff=lfs merge=lfs -text
17
+ *.npz filter=lfs diff=lfs merge=lfs -text
18
+ *.onnx filter=lfs diff=lfs merge=lfs -text
19
+ *.ot filter=lfs diff=lfs merge=lfs -text
20
+ *.parquet filter=lfs diff=lfs merge=lfs -text
21
+ *.pb filter=lfs diff=lfs merge=lfs -text
22
+ *.pickle filter=lfs diff=lfs merge=lfs -text
23
+ *.pkl filter=lfs diff=lfs merge=lfs -text
24
+ *.pt filter=lfs diff=lfs merge=lfs -text
25
+ *.pth filter=lfs diff=lfs merge=lfs -text
26
+ *.rar filter=lfs diff=lfs merge=lfs -text
27
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
28
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
29
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
30
+ *.tar filter=lfs diff=lfs merge=lfs -text
31
+ *.tflite filter=lfs diff=lfs merge=lfs -text
32
+ *.tgz filter=lfs diff=lfs merge=lfs -text
33
+ *.wasm filter=lfs diff=lfs merge=lfs -text
34
+ *.xz filter=lfs diff=lfs merge=lfs -text
35
+ *.zip filter=lfs diff=lfs merge=lfs -text
36
+ *.zst filter=lfs diff=lfs merge=lfs -text
37
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
38
+ # Audio files - uncompressed
39
+ *.pcm filter=lfs diff=lfs merge=lfs -text
40
+ *.sam filter=lfs diff=lfs merge=lfs -text
41
+ *.raw filter=lfs diff=lfs merge=lfs -text
42
+ # Audio files - compressed
43
+ *.aac filter=lfs diff=lfs merge=lfs -text
44
+ *.flac filter=lfs diff=lfs merge=lfs -text
45
+ *.mp3 filter=lfs diff=lfs merge=lfs -text
46
+ *.ogg filter=lfs diff=lfs merge=lfs -text
47
+ *.wav filter=lfs diff=lfs merge=lfs -text
48
+ # Image files - uncompressed
49
+ *.bmp filter=lfs diff=lfs merge=lfs -text
50
+ *.gif filter=lfs diff=lfs merge=lfs -text
51
+ *.png filter=lfs diff=lfs merge=lfs -text
52
+ *.tiff filter=lfs diff=lfs merge=lfs -text
53
+ # Image files - compressed
54
+ *.jpg filter=lfs diff=lfs merge=lfs -text
55
+ *.jpeg filter=lfs diff=lfs merge=lfs -text
56
+ *.webp filter=lfs diff=lfs merge=lfs -text
57
+ # Video files - compressed
58
+ *.mp4 filter=lfs diff=lfs merge=lfs -text
59
+ *.webm filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,186 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-4.0
3
+ configs:
4
+ - config_name: default
5
+ data_files:
6
+ - split: test
7
+ path: data/test-*
8
+ dataset_info:
9
+ features:
10
+ - name: rgb_image
11
+ dtype: image
12
+ - name: rgb_width
13
+ dtype: int64
14
+ - name: rgb_height
15
+ dtype: int64
16
+ - name: xray_images
17
+ list: image
18
+ - name: xray_width
19
+ dtype: int64
20
+ - name: xray_height
21
+ dtype: int64
22
+ - name: objects
23
+ struct:
24
+ - name: rgb_bbox
25
+ list:
26
+ list: float64
27
+ - name: xray_bbox
28
+ list:
29
+ list: float64
30
+ - name: categories
31
+ list: string
32
+ - name: rgb_visible
33
+ list: bool
34
+ - name: xray_visible
35
+ list: bool
36
+ - name: dangerous
37
+ list: bool
38
+ - name: IN_ids
39
+ list: string
40
+ - name: WN_ids
41
+ list: string
42
+ splits:
43
+ - name: test
44
+ num_bytes: 5996075853.088
45
+ num_examples: 1928
46
+ download_size: 5962600768
47
+ dataset_size: 5996075853.088
48
+ ---
49
+
50
+
51
+
52
+ <div align="center">
53
+
54
+ <h1> <a style="color:white; font-weight:bold;" href="https://pagf188.github.io/RAXO/">Superpowering Open-Vocabulary Object Detectors for X-ray Vision</a></h1>
55
+ <h2>ICCV 25</h2>
56
+
57
+ [Pablo Garcia-Fernandez](https://scholar.google.es/citations?user=xbtLSCcAAAAJ&hl=es),
58
+ [Lorenzo Vaquero](https://scholar.google.es/citations?user=G0ZcGDYAAAAJ&hl=es&oi=sra),
59
+ [Mingxuan Liu](https://scholar.google.com/citations?user=egL5-LsAAAAJ&hl=en),
60
+ [Feng Xue](https://scholar.google.com/citations?user=66SeiQsAAAAJ&hl=zh-CN),
61
+ [Daniel Cores](https://scholar.google.com/citations?user=pJqkUWgAAAAJ&hl=es)
62
+ [Nicu Sebe](https://scholar.google.com/citations?user=stFCYOAAAAAJ&hl=en)
63
+ [Manuel Mucientes](https://scholar.google.com/citations?user=raiz6p4AAAAJ)
64
+ [Elisa Ricci](https://scholar.google.com/citations?user=xf1T870AAAAJ&hl=en)
65
+
66
+
67
+ [![arXiv](https://img.shields.io/badge/cs.CV-2410.07752-b31b1b?logo=arxiv&logoColor=red)](https://arxiv.org/abs/2503.17071)
68
+ [![GitHub](https://img.shields.io/badge/GitHub-RAXO-blue?logo=github)](https://github.com/PAGF188/RAXO)
69
+ [![Static Badge](https://img.shields.io/badge/website-RAXO-8A2BE2)](https://pagf188.github.io/RAXO/)
70
+ </div>
71
+
72
+
73
+ ### DET-COMPASS
74
+
75
+ This is the official repository of [RAXO](https://pagf188.github.io/RAXO/) (ICCV25)
76
+
77
+ <div align="center">
78
+ <img src="./figs/compass_qualitative.png" alt="Qualitative DET-COMPASS" width="60%">
79
+ </div>
80
+
81
+
82
+ ### Dataset Summary
83
+
84
+ Object detection in security X-ray scans has advanced significantly in recent years. However, evaluating OvOD detectors in this modality remains challenging due to the limited number of annotated object categories in existing X-ray benchmarks. This limitation severely constrains the comprehensive evaluation of OvOD methods, which require a broad and diverse category set to assess generalization to unseen object semantics. To address this gap, we introduce DET-COMPASS, a novel benchmark that repurposes the COMPASS-XP classification dataset for object detection through meticulous bounding box annotation. DET-COMPASS comprises 370 distinct object classes, offering an order-of-magnitude increase in vocabulary size over previous X-ray detection benchmarks. Additionally, it provides pixel-aligned RGB images, ensuring precise spatial correspondence across modalities and facilitating the development of multimodal models. Each object is also labeled with a visibility attribute, indicating whether it produces a discernible signature in the X-ray spectrum.
85
+
86
+ ### Dataset Structure
87
+
88
+ - 📁 **Low**: Raw 8-bit greyscale data from the scanner’s **low-energy X-ray channel**.
89
+ - 📁 **High**: Raw 8-bit greyscale data from the scanner’s **high-energy X-ray channel**.
90
+ - 📁 **Density**: 8-bit greyscale data representing **inferred material density**, computed by combining the low and high energy channels.
91
+ - 📁 **Grey**: RGB images that blends low and high energy channels with **visual enhancements**. While nominally greyscale, it includes **subtle color details**.
92
+ - 📁 **Colour**: RGB images using a **color palette** to represent material density variations.
93
+ - 📁 **Photo**: RGB images caputred with a RGB camera.
94
+
95
+ - 📄 **meta.txt**: Original metadata from COMPASS-XP, including:
96
+ ```
97
+ basename: Shared ID for each image pair
98
+ class: Object class
99
+ instance: An integer identifying the object instance
100
+ pose: An integer identifying the object pose
101
+ scan tray: Either A, indicating that the pose was imaged in a weighted tray, or N indicating it was not
102
+ dangerous: Boolean indicating aviation threat
103
+ IN_id: ImageNet class ID (if available)
104
+ WN_id: WordNet synset ID (if available)
105
+ ```
106
+ - 📄 **rgb_compass.json** and 📄**xray_compass.json**: Bounding box annotations for both the X-ray (Low, High, Density, Grey, Colour), and the RGB (Photo) images.
107
+ > Note: The category id/name must be retrieved from `meta.txt` (now there is a dummy 1).
108
+ - 📁 **Raxo_splits**: Train/Test splits used in the [RAXO](https://github.com/PAGF188/RAXO) paper, stored in **COCO format** .
109
+ - 📄 **xray_prot.json**: Used to build the prototypes.
110
+ - 📄 **xray_1image_test.json**: Used for test.
111
+
112
+
113
+
114
+ ### Usage
115
+
116
+ ```
117
+ from datasets import load_dataset
118
+ import matplotlib.pyplot as plt
119
+ import matplotlib.patches as patches
120
+
121
+ # 1. Load the dataset
122
+ ds = load_dataset("PAGF/DET-COMPASS", split="test")
123
+
124
+ # 2. Select a sample
125
+ sample = ds[869]
126
+
127
+ # 3. Get the images
128
+ rgb_img = sample["rgb_image"]
129
+ xray_colour_img = sample["xray_images"][0]
130
+ xray_grey_img = sample["xray_images"][1]
131
+ xray_high_img = sample["xray_images"][2]
132
+ xray_low_img = sample["xray_images"][3]
133
+ xray_density_img = sample["xray_images"][4]
134
+
135
+ # 4. Get the bounding boxes ([x_min, y_min, width, height])
136
+ rgb_bboxes = sample["objects"]["rgb_bbox"]
137
+ xray_bboxes = sample["objects"]["xray_bbox"]
138
+
139
+ # 5. Get the classes
140
+ classes = sample["objects"]["categories"]
141
+
142
+ # 6. Draw bounding boxes
143
+ def plot_image(ax, img, bboxes, classes, name=""):
144
+ ax.imshow(img)
145
+ for bbox, cls in zip(bboxes, classes):
146
+ rect = patches.Rectangle(
147
+ (bbox[0], bbox[1]),
148
+ bbox[2], bbox[3],
149
+ linewidth=2, edgecolor='r', facecolor='none'
150
+ )
151
+ ax.add_patch(rect)
152
+ # Draw class name at the top-left corner of the bbox
153
+ ax.text(
154
+ bbox[0], bbox[1] - 5, # Slightly above the bbox
155
+ cls,
156
+ color='yellow', fontsize=10, weight='bold',
157
+ bbox=dict(facecolor='black', alpha=0.5, edgecolor='none', pad=1)
158
+ )
159
+ ax.set_title(name)
160
+ ax.axis("off")
161
+
162
+ fig, axs = plt.subplots(3, 2, figsize=(12, 6))
163
+
164
+ plot_image(ax=axs[0,0], img=rgb_img, bboxes=rgb_bboxes, classes=classes, name="RGB")
165
+ plot_image(ax=axs[0,1], img=xray_colour_img, bboxes=xray_bboxes, classes=classes, name="X-ray Colour")
166
+ plot_image(ax=axs[1,0], img=xray_grey_img, bboxes=xray_bboxes, classes=classes, name="X-ray Grey")
167
+ plot_image(ax=axs[1,1], img=xray_high_img, bboxes=xray_bboxes, classes=classes, name="X-ray High")
168
+ plot_image(ax=axs[2,0], img=xray_low_img, bboxes=xray_bboxes, classes=classes, name="X-ray Low")
169
+ plot_image(ax=axs[2,1], img=xray_density_img, bboxes=xray_bboxes, classes=classes, name="X-ray Density")
170
+
171
+ plt.tight_layout()
172
+ plt.show()
173
+ ```
174
+
175
+ ### Citation
176
+
177
+ If you use DET-COMPASS in your research, please cite:
178
+
179
+ ```bibtex
180
+ @inproceedings{garcia2025superpowering,
181
+ title={Superpowering Open-Vocabulary Object Detectors for X-ray Vision},
182
+ author={Garcia-Fernandez, Pablo and Vaquero, Lorenzo and Liu, Mingxuan and Xue, Feng and Cores, Daniel and Sebe, Nicu and Mucientes, Manuel and Ricci, Elisa},
183
+ booktitle={ICCV},
184
+ year={2025},
185
+ }
186
+ ```
data/test-00000-of-00012.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:07180671d69b5b95c83c351db749c363f2a86886d072a1a30e44a47d838a07ff
3
+ size 513933100
data/test-00001-of-00012.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cfb8efa2f616ccd96729abc1d92bfbd88d4d987bde605b46a191d4ae4a420884
3
+ size 499700488
data/test-00002-of-00012.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3d9001a07dd3eeb96e605fac73d874321f4aa660cf57462904f61cd8f339276a
3
+ size 481311692
data/test-00003-of-00012.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:10ec5f7419b6c5cda2693db2d8d55cc40ef9ad1401e1b88a5f1a3d9267fd549b
3
+ size 486231106
data/test-00004-of-00012.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6b9357bfa4a4066338629ccdcd682c8fe163f0778fbbc0f744cc9e3f3a9eca04
3
+ size 492999637
data/test-00005-of-00012.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c06f451930fdec2db41c340ed3e3f5f2415c46a40a555dd2a6ba9dd61792c8b0
3
+ size 503347022
data/test-00006-of-00012.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:69c12e7cc8ae8470b196faf97fa12331be1b0eeda1f66daf05b604e96c772b62
3
+ size 496947653
data/test-00007-of-00012.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aa2dbb6cb6c62ab1e3239100310bb2851fffbf9a3d091f0f741f5f6a77e6a99b
3
+ size 492143641
data/test-00008-of-00012.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ffd3cb64bab5082b977d40852173725f21da8cd3a141f8bbf92fe195ae0e73a8
3
+ size 500988989
data/test-00009-of-00012.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8a2651e2042c11bff842bf56e1cb26003ad7366e3d662e67ba363d0b8d403e02
3
+ size 494659875
data/test-00010-of-00012.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:82c07926c8312bd6352251fed27d8ba4195bc690a8630cea26f293fbb0610d58
3
+ size 503512907
data/test-00011-of-00012.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c4443b9a39ab713901435a9aae92b70f10b4f3fb06852c9f5b8a5644098e53a1
3
+ size 496824658