- We propose Xsyn, a simple and effective one-stage synthesis pipeline in the X-ray security domain. To the best of our knowledge, Xsyn is the first to achieve high quality X-ray security image synthesis without incurring additional labor-intensive foreground preparation.
- Enviroment: We provide enviroment.yml to setup enviroment.
- Data: PIDray, OPIXray and HiXray.
We will provide checkpoints for different datasets. All models here are based on GLIGEN.
| Dataset | Mode | Download |
|---|---|---|
| PIDray | text-grounded inpainting | HF Hub |
| OPIXray | text-grounded inpainting | HF Hub |
| HiXray | text-grounded inpainting | HF Hub |
Please follow the instruction of text-grounded inpainting training in GLIGEN.
We provide one script to generate x-ray security images and construct their annotations. First download models and put them in --ckpt_path. Then run
python gligen_inference.pyDetails of some important args:
--output_path: the path to save your generated x-ray security images--annotation_path: the path to save the refined annotation(stored in txt format)--vis_path: the path to save visualization compared with gt--ca_vis_path: the path to save cross-attention maps--image_path: the path to load images you want to inpaint--ckpt_path: the generation model checkpoint path--gligen_caption_pt: the file to prepare your training/test data in GLIGEN format--gen_method: set to 1 for Xsyn-M and 3 for Xsyn-A--refine_anno: set to True forCAR--latent_redist: set to True forBOM
After inference, we use downstream_test.sh to test the performance of our sythetic data. Our downstream detection environment is mmdetection.
This work is implemented based on GLIGEN. We greatly appreciate their valuable contributions to the community.
