Skip to content

rstao-bjtu/LDXray

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

LDXray: A Dataset for X-ray Prohibited Items Detection

Introduction

LDXray is a large-scale dual-view dataset collected from real security scenes in transportation hubs. It contains a wide range of prohibited items categorized into 12 different classes.

Sample image from LDXray dataset

Dataset Download

The dataset and code can be accessed from the following links:

Code

  • Installation Please follow the official environment setup guide of MMdetection.

  • Side-View pseudo-label Use ld-tools/sail2bbox.py to get pseudo-label for side-view data , you can define the target_category_ids to any classes you need.The input_json_path should be the main view annotation file.

  • Main-View Slicing Use ld-tools/gen-main-view-slice-json-wider.py to get sliced main-view data for training sliced images detector.You can extract a subset of spesific classes first to get spesific classes dataset.

  • Config Update the config file of dataset in ld-config/base/datasets.
    Update the num_classes in main config when taining specific classes of side-view model and sliced image model.

  • Train

python tools/train.py ld-config/ld-retinanet/main-view-retinanet.py
python tools/train.py ld-config/ld-retinanet/sliced-retinanet.py
python tools/train.py ld-config/ld-retinanet/side-view-retinanet.py
  • Side-view inference
python tools/test.py ld-config/ld-retinanet/side-view-retinanet.py work_dirs/side-view-retinanet/epoch_12.pth --out side-view-retinanet.pkl
  • pkl2json Use ld-tools/pkl2jon.py to convert the side-view-retinanet.pkl to side-view-retinanet.pkl. The categoriy_id will be start from 1 ,you should update the categoriy_id by yourself.

  • Side-view to main-view Use ld-tools/dv-proposal.py to get main-view region proposals from side-view prediction.

  • Auxiliary Prediction Update the test config in sliced-retinanet.py(Using the new json of Step 'side-view to main-view' ) to inference main-view region proposals predicted by side-view model.

python tools/test.py ld-config/ld-retinanet/sliced-retinanet.py work_dirs/side-view-retinanet/epoch_12.pth --out sliced-retinanet.pkl

Citation

If you use LDXray in your research, please consider citing:

@inproceedings{tao2024dual,
  title={Dual-view X-ray Detection: Can AI Detect Prohibited Items from Dual-view X-ray Images like Humans?},
  author={Tao, Renshuai and Wang, Haoyu and Guo, Yuzhe and Chen, Hairong and Zhang, Li and Liu, Xianglong and Wei, Yunchao and Zhao, Yao},
  booktitle={2025 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
  year={2025},
  organization={IEEE}
}

Contact

For any questions, please contact Renshuai Tao.


About

No description, website, or topics provided.

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages