📦 Dataset: https://doi.org/10.5281/zenodo.22861165 📄 Paper: https://arxiv.org/abs/2311.12857
- 'line.py' and 'spot.py' contains code to generate adversarial samples with HLine, VLine and Spot respectively.
- Download the dataset from this [link](https://kaggle.com/datasets/19bdc7feafbf89240300cebbf9b5b6db40d796b4fa7d76069ab3789201869322.
- Put the dataset inside the 'images/Segments_Sorted/' directory.
- run 'ALPR.ipynb'
- Configure 'data_path', and 'save_path' as necessary.
- run 'main.py'
- Configure 'mode', 'model_path', 'op_path, and 'output_path' as necessary.
- The 'model_path' must be directed to the model intended to use.
- run 'testing.py'
- run 'AdversarialTraining.ipynb'
- Configure 'save_path' as necessary.
- run 'heatmap.py'
- Configure 'model_path' and 'output_path' as necessary.
- run 'gif_creation.py'
- Consifure 'output_path'
- Copy and paste code below at appropriate location in spot.py or line.py of which gif you want to create
pert_img = create_spot(img.copy(), center_i, radius, rgb)
pert_image = numpy_PIL_tensor(pert_img)
#Saving the perturbed image
output_path = 'outputs/gif3/'
output_file_name = f"{radius}-{center_i}.png"
os.makedirs(output_path, exist_ok=True)
pert_image = pert_image.view(3, 160, 105)
save_image(pert_image, output_path + output_file_name)- Use the generated image to create gif from here.


