deepinsight / deepinsight/insightface

Replace deprecated SimilarityTransform.estimate() with SimilarityTransform.from_estimate()

Open
#2,876 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
29.7k
Forks
6.1k
PR merge metrics
No merged PRs in 30d

Description

scikit-image 0.26 deprecated `SimilarityTransform.estimate()` in favor of the `SimilarityTransform.from_estimate()` class constructor ([scikit-image#7771](https://github.com/scikit-image/scikit-image/pull/7771)). It will be removed in scikit-image 2.2.

This produces a `FutureWarning` on every face alignment call:

```
insightface/utils/face_align.py:23: FutureWarning: `estimate` is deprecated since version 0.26
and will be removed in version 2.2. Please use `SimilarityTransform.from_estimate` class
constructor instead.
```

The fix is a one-liner in `insightface/utils/face_align.py`:

```python
# Before
tform = SimilarityTransform()
tform.estimate(dst, src)

# After
tform = SimilarityTransform.from_estimate(dst, src)
```

**Environment:** insightface 0.7.3, scikit-image 0.26.0, Python 3.13

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.