SketchLattice @ICCV21
This is the official implementation (PyTorch) of SketchLattice: Latticed Representation for Sketch Manipulation https://arxiv.org/abs/2108.11636
There are 10 categories randomly selected from the QuickDraw Dataset for all experiments. You can dowanload the data (one .npz file per class) from Google Cloud.
After downloading, please unzip and place all the npz files into the ./dataset directory.
To get started, a preprocess step needs to be done firstly by using the script sketch2GraphAndAdjScript.py. You can simply run the following command.
python -u sketch2GraphAndAdjScript.py- Before running the script, you should edit the following haperparameters:
outPath: Path to place the preprocessed datasets.split_nums: Sampling density or Grid n, the default value is 32.node_nums: Graph Nodes v, the default value is 150.mode(train/test): Preprocess on the train/test datasets.
- After running the script, you will get
*_adjs_train(test).npzand*_nodes_train(test).npzfor training(testing) in the output directory.
Setup environment via requirements.txt
pip install -r requirements.txt- Before running the script, you should edit
generation_hyper_params.pyto modify the following haperparameters if you need:
self.data_location: Path to place the preprocessed datasets.self.save_path: Path to place checkpoints and results.self.category: Categories you choose to train or validate.self.row_column: Sampling density or Grid n, the default value is 32.self.graph_number: Graph Nodes v, the default value is 150.self.mask_prob: Corruption levels p, the default value is 0.1.
- For training, run
python -u generation_sketch_gcn.pyTrained models (encoder & decoder) are available in ./models_32_150.
-
Before running the testing script, you should edit
generation_hyper_params.pyto modify the haperparameters as well. -
For validating, run
python -u generation_inference.pyThank you for citing our work if it is helpful!
@inproceedings{yonggang2021sketchlattice,
title={SketchLattice: Latticed Representation for Sketch Manipulation},
author={Yonggang Qi, Guoyao Su, Pinaki Nath Chowdhury, Mingkang Li, Yi-Zhe Song},
booktitle={ICCV},
year={2021}
}
