Download Links for the Pre-Trained Renderer and Actor Models in LearningToPaint

The hzwer/iccv2019-learningtopaint repository hosts two Google Drive checkpoints—renderer.pkl (neural renderer) and actor.pkl (DRL policy)—that are required to run inference without training from scratch.

The LearningToPaint project implements the ICCV 2019 paper on stroke-based neural painting using deep reinforcement learning. To reproduce the results or generate paintings using the provided inference scripts, you must obtain the download links for the pre-trained renderer and actor models documented in the repository's README.md at line 35.

The repository distributes two PyTorch model files trained on the CelebA dataset. These weights initialize the neural renderer and the policy network used during inference.

Renderer Model (renderer.pkl)

The renderer.pkl file contains the state dictionary for the neural renderer (Decoder class) trained to convert stroke parameters into rasterized canvas images.

Actor Model (actor.pkl)

The actor.pkl file stores the complete DRL actor (policy network) that predicts stroke actions to minimize the visual difference between the canvas and target image.

How to Download the Models via Command Line

Use wget with the Google Drive export URLs to retrieve both files directly to your working directory. These commands match the specifications provided in the repository documentation:


# Download the neural renderer (Decoder network)

wget "https://drive.google.com/uc?export=download&id=1-7dVdjCIZIxh8hHJnGTK-RA1-jL1tor4" -O renderer.pkl

# Download the DRL actor (policy network)

wget "https://drive.google.com/uc?export=download&id=1a3vpKgjCVXHON4P7wodqhCgCMPgg1KeR" -O actor.pkl

Loading the Pre-Trained Models in Python

After downloading, load the checkpoints using PyTorch. The renderer requires instantiation of the Decoder architecture from model.py, while the actor loads as a complete serialized object. Both must be set to evaluation mode before inference:

import torch
from model import Decoder  # Neural renderer class definition

# Load the pre-trained renderer

renderer = Decoder()
renderer.load_state_dict(torch.load("renderer.pkl"))
renderer.eval()

# Load the pre-trained actor (DRL policy)

actor = torch.load("actor.pkl")
actor.eval()

These initialized objects integrate with the high-level predict API in predict.py or the evaluation routines in baseline/test.py and baseline_modelfree/test.py.

Integration with Repository Scripts

The downloaded weights are hardcoded dependencies for several key files in the codebase:

  • predict.py: High-level inference wrapper that expects renderer.pkl and actor.pkl in the working directory to generate paintings from input images
  • baseline/test.py: Evaluation script for the baseline agent that loads both checkpoints to run test episodes
  • baseline_modelfree/test.py: Model-free baseline variant that also requires these specific weight files

Ensure both .pkl files are accessible from the path where you execute these scripts, or modify the loading paths in the source files to match your download location.

Summary

  • Two checkpoints are required: renderer.pkl (neural renderer state dict) and actor.pkl (complete DRL policy), both trained on CelebA
  • Google Drive hosts the files with direct download endpoints compatible with wget commands
  • The renderer loads via Decoder().load_state_dict() while the actor loads directly via torch.load()
  • Both models are required to execute predict.py and the test scripts in baseline/ and baseline_modelfree/
  • Set both networks to .eval() mode before inference to ensure deterministic behavior

Frequently Asked Questions

What is the difference between the renderer and actor models?

The renderer (renderer.pkl) is a neural network implemented as the Decoder class that simulates the painting environment by converting stroke parameters into pixel images. The actor (actor.pkl) is the reinforcement learning policy network that observes the current canvas state and decides which strokes to paint next to minimize reconstruction loss. The renderer provides the visual feedback, while the actor provides the decision-making strategy.

What dataset were these pre-trained models trained on?

According to the repository documentation, both renderer.pkl and actor.pkl were trained on the CelebA dataset, which consists of over 200,000 celebrity face images. This training enables the models to generate coherent portrait paintings with realistic facial features and textures when processing human faces.

Which scripts require these pre-trained checkpoints?

The repository requires these models in three primary locations: predict.py uses both checkpoints for high-level inference on new images, while baseline/test.py and baseline_modelfree/test.py load them during evaluation episodes. Without these files, the scripts will fail when attempting to initialize the neural renderer or policy network objects.

How do I load these models for custom inference?

Load the renderer by importing Decoder from model.py, instantiating the class, and calling load_state_dict(torch.load("renderer.pkl")). Load the actor directly using actor = torch.load("actor.pkl"). Always call .eval() on both models before generating predictions to disable dropout and ensure batch normalization uses running statistics rather than batch statistics.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →