Skip to content
View ref2sketch's full-sized avatar

Block or report ref2sketch

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Please don't include any personal information such as legal names or email addresses. Maximum 100 characters, markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
ref2sketch/README.md

Reference based sketch extraction via attention mechanism

This is official implementation of the paper "Reference based sketch extraction via attention mechanism"

Amirsaman Ashtari*, Chang Wook Seo*, Cholmin Kang, Sihun Cha, Junyong Noh (*equally contributed and listed alphabetically)

PAPER

Journal: ACM TOG
Conference: SIGGRAPH ASIA 2022

Train

$ python main.py --mode train_deep \
                 --scope ref2sketch \
                 --name_data examples \
                 --dir_data ./datasets \
                 --dir_log ./log \
                 --dir_checkpoint ./checkpoint \
                 --direction a2b
                 --gpu_ids 0
  • For settings from original paper, use 'train' for --mode. However we recommend to use 'train_deep' for producing better quality of model with deeper convolution layers.
  • To understand hierarchy of dataset, see Dataset directories structure below.

Test

$ python test.py --name_weight [weight_file] \
                 --name_data examples \
                 --direction a2b \
                 --cuda

Dataset

  • Due to the regulation of twitter, we share each url of twitter dataset used in our paper. You can find twitter_dataset.json file from dataset folder.

Twitter regulation
https://developer.twitter.com/en/developer-terms/agreement-and-policy

Dataset directories structure

ref2sketch
+---[dir_data]
|   \---[name_data]
|       +---test
|       |   +---a
|       |       |   +---test_input1.png
|       |       |   +---test_input2.png
|       |   +---b
|       |       |   +---test_groundtruth1.png #not necessary for testing
|       |       |   +---test_groundtruth2.png #not necessary for testing
|       |   +---c
|       |       |   +---style1.png
|       |       |   +---style2.png
|       +---train
|       |   +---a
|       |       |   +---train_input1.png
|       |       |   +---train_input2.png
|       |   +---b
|       |       |   +---train_groundtruth1.png
|       |       |   +---train_groundtruth2.png

#Paired input and groundtruth should have same filename

Examples


Popular repositories Loading

  1. ref2sketch ref2sketch Public

    This is (official) pytorch implementation of the paper "Reference based sketch extraction via attention mechanism"

    Python 34 4