executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
model-apiUse when working with RobustVideoMatting MattingNetwork APIs, recurrent states, model variants, refiners, tensor shapes, and safe synthetic forward checks.
Independent GitHub snapshot · Automated classification · Original documentation governs
Use this sub-skill when the task is about constructing or calling the RVM PyTorch model itself rather than converting videos, preparing training data, or running evaluation metrics.
MattingNetwork with mobilenetv3 or
resnet50.downsample_ratio,
segmentation_pass, foreground/alpha tensor shapes, or channel/rank errors.deep_guided_filter or
fast_guided_filter as the refiner.Route other tasks elsewhere:
DATA_PATHS, training stages, losses, or augmentations:
training-data.Ensure the RVM source modules are importable as model and that PyTorch and
TorchVision are installed. If in doubt, run the bundled smoke helper:
python scripts/rvm_model_smoke.py --repo-root /path/to/RobustVideoMatting --variant mobilenetv3 --device cpu
Instantiate the model without downloading backbone weights unless the user explicitly wants that side effect:
from model import MattingNetwork
model = MattingNetwork(variant="mobilenetv3").eval()
# or: MattingNetwork(variant="resnet50")
Feed RGB tensors normalized to 0..1 in channel-first format:
[B, C, H, W][B, T, C, H, W]Recycle all four recurrent states in temporal order:
rec = [None] * 4
fgr, pha, *rec = model(src, *rec, downsample_ratio=0.25)
Validate the output contract. Matting mode returns foreground fgr, alpha
pha, and four recurrent states. segmentation_pass=True returns
segmentation logits plus recurrent states, not foreground/alpha.
mobilenetv3 for most inference and smoke tests because it is the
smaller recommended variant. Use resnet50 when the user explicitly wants
the larger model with modest quality improvement.refiner="deep_guided_filter" unless the task specifically asks for the
faster guided-filter refiner or export behavior.[B,T,C,H,W]) to improve parallelism while preserving
temporal recurrence across chunks. Carry only the returned four state tensors
into the next chunk.A good answer for this surface names the exact tensor rank/order, explains the four recurrent states, states whether the call returns fgr/pha or segmentation logits, includes a small validation snippet or smoke command, and routes any conversion/training/evaluation work to the owning sub-skill.