This repository implements a PyTorch-based refactor of "ArtCoder: An End-to-end Method for Generating Scanning-robust Stylized QR Codes". The code has been restructured to enhance readability, scalability, and computational efficiency by leveraging PyTorch's built-in functions for tensor operations.
To set up the environment:
- Create a virtual environment:
virtualenv --python=python3.10 artcoder
- Activate the environment:
source artcoder/bin/activate
- Install the dependencies:
pip install -r requirements.txt
To generate the aesthetic qrcode, run the following:
python generate_aesthetic_qrcode.py \
--qrcode_image_path <path_to_qrcode_image> \
--content_image_path <path_to_content_image> \
--style_image_path <path_to_style_image> \
--output_path <path_to_output_image>
Below is an example of generating an aesthetic qrcode from an inputs:
Original Image | Aesthetic QR Code |
We implemented the code on an environment running Ubuntu 22.04.1, utilizing a 12th Generation Intel(R) Core(TM) i7-12700 CPU, along with a single NVIDIA GeForce RTX 4090 GPU equipped with 24 GB of dedicated memory.
If you use this code, please cite the following repository:
@misc{liao2024artcoder,
title = {A PyTorch implementation of ArtCoder},
author = {Jia-Wei Liao},
url = {https://github.com/jwliao1209/ArtCoder},
year = {2024}
}
Additionally, please reference the original paper:
@inproceedings{su2021artcoder,
title = {Artcoder: an end-to-end method for generating scanning-robust stylized qr codes},
author = {Hao Su, Jianwei Niu, Xuefeng Liu, Qingfeng Li, Ji Wan, Mingliang Xu, Tao Ren},
booktitle = {CVPR},
year = {2021}
}