Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Generating Object Stamps

This is the official code base for the paper: Generating object Stamps.

Presented in the AI for Content Creation CVPR workshop 2020 (AI4CCW).

This code has been trained on python 3.7 on a ubuntu system with 2xGPU (GTX 1080ti).

Alt text

Install requirements

Create a conda environment and install requirements:


Activate environment:

conda activate stamps

Create data and train

To run the code, Follow the steps bellow:

python Yo


python --path /home/yam28/Documents/phdYoop/datasets/COCO --dataset giraffe --mode val

You are now ready to start training:

  • Training the mask generation part can be done via:

python --dataset giraffe --data ./dataset --path /home/yam28/Documents/phdYoop/datasets/COCO

The argument 'data' is where the generated data above is stored.

The argument 'path' being the path for the coco dataset.

The argument 'dataset' specifies the name of the dataset.

The training logs and checkpoints will be stored under the folder 'train_log'.

  • Training the texture generation part can be done via:

python --dataset giraffe --data ./dataset --path /home/yam28/Documents/phdYoop/datasets/COCO --load ./vgg_16.ckpt

The training logs and checkpoints will be stored under the folder 'train_log'.

  • You can chek intermediate results while training using tensorboard. First cd to the checkpoint directory and use:

tensorboard --logdir=.


The process for inference is visualized below:

Alt text

When the training is finished, the graphs for both mask and texture generation are frozen and automatically saved under 'frozen_model.pb' in the corresponding folders in 'train_log'. To visualize results on new images using bounding boxes from the validation set, run the command below with the appropriate arguments, in my case this would be:

python --mask_model ./train_log/giraffe/mask_gen/20200113-113913/frozen_model.pb --rgb_model ./train_log/giraffe/rgb_gen/20200113-114121/frozen_model.pb --mask_folder ./dataset/val/giraffe --bg_folder ./bg_data/savannah

where the arguments are described below:

'mask_model': the path for 'frozen_model.pb' corresponding to the mask generation.

'rgb_model': the path for 'frozen_model.pb' corresponding to the texture generation.

'mask_folder': is the validation folder created by

'bg_folder': The path to a folder containing the background images on top which you would like to generate stamps.


Official implementation of Generating Object Stamps







No releases published


No packages published