Skip to content
Back to skills

Lipvertexerror

ASecurity

Compute the LipVertexError metric — provided by torchmetrics. Use when the user has predictions and ground-truth and needs to compute LipVertexError, or asks how to score with LipVertexError.

  • 3 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 11, 2026
documentationpython

Works with

  • cli

Security analysis

A100/100

Scanned September 11, 2026

npx -y skills add qhjqhj00/research-skills-pool --skill lipvertexerror --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Lipvertexerror?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Lipvertexerror
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/qhjqhj00-lipvertexerror/badge)](https://www.skillsdirectory.com/skills/qhjqhj00-lipvertexerror)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: lipvertexerror
description: Compute the LipVertexError metric — provided by torchmetrics. Use when the user has predictions and ground-truth and needs to compute LipVertexError, or asks how to score with LipVertexError.
metadata:
  skill_kind: metric
  source_lib: torchmetrics
  import_path: torchmetrics.multimodal.LipVertexError
  source: library_introspection
---

# lipvertexerror

> Metric `LipVertexError` from `torchmetrics` (torchmetrics.multimodal.LipVertexError)

## When to invoke this skill

The user has predictions + ground truth and asks to evaluate with LipVertexError, or
mentions `torchmetrics.multimodal.LipVertexError` directly, or wants the standard torchmetrics implementation.

## Reference signature

```python
from torchmetrics.multimodal import LipVertexError

# LipVertexError(mouth_map: List[int], validate_args: bool = True, **kwargs: Any) -> None
```

## Library docstring

```
Implements Lip Vertex Error (LVE) metric for 3D talking head evaluation.

The Lip Vertex Error (LVE) metric evaluates the quality of lip synchronization in 3D facial animations by measuring
the maximum Euclidean distance (L2 error) between corresponding lip vertices of the generated and ground truth
meshes for each frame. The metric is defined as:

.. math::
    \text{LVE} = \frac{1}{N} \sum_{i=1}^{N} \max_{v \in \text{lip}} \|x_{i,v} - \hat{x}_{i,v}\|_2^2

where :math:`N` is the number of frames, :math:`x_{i,v}` represents the 3D coordinates of vertex :math:`v` in the
lip region of the ground truth frame :math:`i`, and :math:`\hat{x}_{i,v}` represents the corresponding vertex in the
predicted frame. The metric computes the maximum squared L2 distance between corresponding lip vertices for each
frame and averages across all frames. A lower LVE value indicates better lip synchronization quality.

As input to ``forward`` and ``update``, the metric accepts the following input:

- ``preds`` (:class:`~torch.Tensor`): Predicted vertices tensor of shape (T, V, 3) where T is number of frames,
            V is number of vertices, and 3 represents XYZ coordinates
- ``target`` (:class:`~torch.Tensor`): Ground truth vertices tensor of shape (T', V, 3) where T' can be different
            from T

As output of ``forward`` and ``compute``, the metric returns the following output:

- ``lve_score`` (:class:`~torch.Tensor`): A scalar tensor containing the mean Lip Vertex Error value across
            all frames.

Args:
    mouth_map: List of vertex indices corresponding to the mouth region
    validate_args: bool indicating if input arguments and tensors should be validated for correctness.
        Set to ``False`` for faster computations.
    kwargs: Additional keyword arguments, see :ref:`Metric kwargs` for more info.

Raises:
    ValueError:
        If the number of dimensions of `vertices_pred` or `vertices_gt` is not 3.
        If vertex dimensions (V) or coordinate dimensions (3) don't match
        If ``mouth_map`` is empty or contains invalid indices

Example:
    >>> import torch
    >>> from torchmetrics.functional.multimodal import lip_vertex_error
    >>> vertices_p
```

## Quick recipe

```python
import torchmetrics.multimodal as _m
score = _m.LipVertexError(y_true, y_pred)
```

## Don'ts

- Don't reimplement when the library version handles edge cases (NaN, ties, empty inputs) better than a hand-rolled formula.
- Always check the library version's argument order — sklearn is `(y_true, y_pred)` while torchmetrics is `(preds, target)`.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.