Compute the DeepImageStructureAndTextureSimilarity metric — provided by torchmetrics. Use when the user has predictions and ground-truth and needs to compute DeepImageStructureAndTextureSimilarity, or asks how to score with DeepImageStructureAndTextureSimilarity.
Scanned 9/11/2026
Install to Claude Code
npx -y skills add qhjqhj00/research-skills-pool --skill deepimagestructureandtexturesimilarity --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Deepimagestructureandtexturesimilarity?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/qhjqhj00-deepimagestructureandtexturesimilarity)More formats (shields.io, HTML) on the badges page.
---
name: deepimagestructureandtexturesimilarity
description: Compute the DeepImageStructureAndTextureSimilarity metric — provided by torchmetrics. Use when the user has predictions and ground-truth and needs to compute DeepImageStructureAndTextureSimilarity, or asks how to score with DeepImageStructureAndTextureSimilarity.
metadata:
skill_kind: metric
source_lib: torchmetrics
import_path: torchmetrics.image.DeepImageStructureAndTextureSimilarity
source: library_introspection
---
# deepimagestructureandtexturesimilarity
> Metric `DeepImageStructureAndTextureSimilarity` from `torchmetrics` (torchmetrics.image.DeepImageStructureAndTextureSimilarity)
## When to invoke this skill
The user has predictions + ground truth and asks to evaluate with DeepImageStructureAndTextureSimilarity, or
mentions `torchmetrics.image.DeepImageStructureAndTextureSimilarity` directly, or wants the standard torchmetrics implementation.
## Reference signature
```python
from torchmetrics.image import DeepImageStructureAndTextureSimilarity
# DeepImageStructureAndTextureSimilarity(reduction: Optional[Literal['mean', 'sum']] = 'mean', **kwargs: Any) -> None
```
## Library docstring
```
Calculates Deep Image Structure and Texture Similarity (DISTS) score.
The metric is a full-reference image quality assessment (IQA) model that combines sensitivity to structural
distortions (e.g., artifacts due to noise, blur, or compression) with a tolerance of texture resampling
(exchanging the content of a texture region with a new sample of the same texture). The metric is based on
a convolutional neural network (CNN) that transforms the reference and distorted images to a new representation.
Within this representation, a set of measurements are developed that are sufficient to capture the appearance
of a variety of different visual distortions.
As input to ``forward`` and ``update`` the metric accepts the following input
- ``preds`` (:class:`~torch.Tensor`): tensor with images of shape ``(N, 3, H, W)``
- ``target`` (:class:`~torch.Tensor`): tensor with images of shape ``(N, 3, H, W)``
As output of `forward` and `compute` the metric returns the following output
- ``lpips`` (:class:`~torch.Tensor`): returns float scalar tensor with average LPIPS value over samples
Args:
reduction: specifies the reduction to apply to the output.
kwargs: Additional keyword arguments, see :ref:`Metric kwargs` for more info.
Raises:
ValueError:
If `reduction` is not one of ["mean", "sum"]
Example:
>>> from torch import rand
>>> from torchmetrics.image.dists import DeepImageStructureAndTextureSimilarity
>>> metric = DeepImageStructureAndTextureSimilarity()
>>> preds = rand(10, 3, 100, 100)
>>> target = rand(10, 3, 100, 100)
>>> metric(preds, target)
tensor(0.1882, grad_fn=<CloneBackward0>)
```
## Quick recipe
```python
import torchmetrics.image as _m
score = _m.DeepImageStructureAndTextureSimilarity(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)`.
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!