百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
G

GlideFaceDetectionTransformation

> 开发工具
开源

一款内存效率高的 Android 图像转换库,为 Glide 提供了在人脸检测(人脸中心化)之后的裁剪功能。

359 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

一款内存效率高的 Android 图像转换库,为 Glide 提供了在人脸检测(人脸中心化)之后的裁剪功能。

Glide face detection transformation

An Android image transformation library providing cropping above Face Detection for Glide

Are you using Picasso? PicassoFaceDetectionTransformation.

Are you using Fresco? FrescoFaceDetectionProcessor.

Results

Original Image

Results after cropping

Original Image

Results after cropping

Original Image

Results after cropping

Original Image

Results after cropping

You can read more on my Medium article.

How to use it?

STEP 1:

Grab via Gradle

repositories {
    jcenter()
}
dependencies {
    compile 'com.github.aryarohit07:glide-facedetection-transformation:0.3.0'
}

Or via Maven


  com.github.aryarohit07
  glide-facedetection-transformation
  0.3.0

STEP 2:

Initialize the detector (May be in onCreate() method)

java
GlideFaceDetector.initialize(context);

STEP 3:

Set glide transform

java
Glide.with(yourFragment)
    .load(yourUrl)
    .transform(new FaceCenterCrop())
    .into(yourView);

STEP 4:

The face detector uses native resources in order to do detection. For this reason, it is necessary to release the detector instance once it is no longer needed (May be in onDestory() method)

java
GlideFaceDetector.releaseDetector();

Note: If no face is detected, it will fallback to CENTER CROP.

Library dependencies:

java
com.google.android.gms:play-services-vision:9.4.0
com.github.bumptech.glide:glide:3.7.0

If you liked it, please Star it.

TODO

  • Making it generic for any point.

Performance: Time taken to detect faces in the original image.

width height time taken(ms)
640 360 60-150
900 600 100-200
1280 720 250-350
1920 1080 350-400
2048 1536 500-550

License

Copyright 2016 Rohit Arya

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Javaandroiddetect-facesface-detectionglide

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类开发工具
定价开源

> 相关工具

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具