How hzwer/iccv2019-learningtopaint works
Project type and purpose
• This is a research‐codebase for “Learning to Paint” (ICCV2019) using model-based deep reinforcement learning.
• It provides two variants: baseline (model-based) and baseline_modelfree (model-free) approaches to train painting agents.
• The goal is to train an RL agent that outputs painting strokes to approximate a target image, using a differentiable neural renderer as the environment.
File structure
• Top level
• LearningToPaint.ipynb: Colab demo notebook
• README.md, LICENSE, .gitignore
• cog.yaml: configuration for model serving
• demo/, image/: sample outputs
• predict.py: inference script
• baseline/ and baseline_modelfree/
• DRL/: actor.py (policy network), critic.py (value network), ddpg.py (trainer), evaluator.py (evaluation loop), rpm.py (replay buffer), multi.py (multi-process training), wgan.py (auxiliary generative model)
• Renderer/: model.py (neural renderer architecture), stroke_gen.py (stroke parameterization)
• env.py: defines the RL environment interface, integrates target image, renderer, stroke action → next state, reward
• train_renderer.py: standalone training loop for neural renderer
• train.py: RL training entrypoint
• test.py: runs trained actor & renderer to generate stroke sequence images
• utils/: tensorboard.py (logging), util.py (helper functions)
• Other
• predict.py: high-level inference outside the baseline folders
README for additional insights
• Describes dual-phase training: first train neural renderer on synthetic stroke data, then train painting agent via DRL.
• Highlights dependencies: PyTorch, tensorboardX, OpenCV.
• Indicates data layout (CelebA images under data/img_align_celeba/) but data folder isn’t in repo.
• Provides usage commands for training/testing pipelines.
Final advice
• Be exhaustive: include all DRL subcomponents (actor, critic, replay buffer).
• Both phases (renderer vs agent) distinctly.
• Maintain modular grouping to reflect the baseline vs baseline_modelfree directories.