This repository contains trained
ColorMaskNeuralRenderer that learned to mimic
WatercolorBrush (these
are components of my
Stylized Neural Painting paper reimplementation).
1from huggingface_hub import hf_hub_download
2from painting.brushes import WatercolorBrush, ColorMaskNeuralRenderer
3
4# Specify your device and output canvas size.
5device = "cuda"
6out_canvas_size = 512
7
8brush = WatercolorBrush(canvas_size=out_canvas_size, device=device)
9differentiable_brush = ColorMaskNeuralRenderer(
10 brush_params_count=brush.brush_params_count,
11 color_params_indices=[7, 8, 9],
12 canvas_size=128,
13 device=device,
14)
15
16weights = hf_hub_download(repo_id="Druudik1/watercolor-brush", filename="neural_renderer.pt")
17differentiable_brush.load_state_dict(
18 torch.load(weights, map_location=device, weights_only=True)
19)