Skip to content

Commit 257b400

Browse files
committed
version 0.3.0 release
1 parent 19358a6 commit 257b400

File tree

6 files changed

+64
-15
lines changed

6 files changed

+64
-15
lines changed

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
Version 0.3.0 *(14-08-2016)*
2+
----------------------------
3+
4+
* Face Detector initialization is moved to background thread.
5+
* CenterFaceCrop is changed to **FaceCenterCrop**
6+
* Multiple faces in the image are being considered.
7+
* Bug fixes
8+
9+
**Library dependencies updated:**
10+
```java
11+
com.google.android.gms:play-services-vision:9.4.0
12+
com.squareup.picasso:picasso:2.5.2
13+
```
14+
15+
116
Version 0.2.1 *(23-07-2016)*
217
--------------------------
318

README.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ repositories {
5656
jcenter()
5757
}
5858
dependencies {
59-
compile 'com.github.aryarohit07:picasso-facedetection-transformation:0.2.1'
59+
compile 'com.github.aryarohit07:picasso-facedetection-transformation:0.3.0'
6060
}
6161
```
6262

@@ -66,7 +66,7 @@ Or via Maven
6666
<dependency>
6767
<groupId>com.github.aryarohit07</groupId>
6868
<artifactId>picasso-facedetection-transformation</artifactId>
69-
<version>0.2.1</version>
69+
<version>0.3.0</version>
7070
</dependency>
7171
```
7272

@@ -88,7 +88,7 @@ Picasso
8888
.load(url)
8989
.fit() // use fit() and centerInside() for making it memory efficient.
9090
.centerInside()
91-
.transform(new CenterFaceCrop(100, 100)) //in pixels. You can also use CenterFaceCrop(width, height, unit) to provide width, height in DP.
91+
.transform(new FaceCenterCrop(100, 100)) //in pixels. You can also use FaceCenterCrop(width, height, unit) to provide width, height in DP.
9292
.into(imageView);
9393
```
9494

@@ -105,7 +105,7 @@ PicassoFaceDetector.releaseDetector();
105105
Library dependencies:
106106
------
107107
```java
108-
com.google.android.gms:play-services-vision:9.2.1
108+
com.google.android.gms:play-services-vision:9.4.0
109109
com.squareup.picasso:picasso:2.5.2
110110
```
111111

@@ -114,9 +114,18 @@ com.squareup.picasso:picasso:2.5.2
114114

115115
TODO
116116
----
117-
* Support for multiple faces.
118117
* Making it generic for any point.
119118

119+
**Performance:**
120+
Time taken to detect faces in the original image.
121+
| width | height | time taken(ms) |
122+
|-------|--------|----------------|
123+
| 640 | 360 | 60-150 |
124+
| 900 | 600 | 100-200 |
125+
| 1280 | 720 | 250-350 |
126+
| 1920 | 1080 | 350-400 |
127+
| 2048 | 1536 | 500-550 |
128+
120129
License
121130
-------
122131

gradle.properties

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ BUILD_TOOLS_VERSION=23.0.2
55
TARGET_SDK_VERSION=23
66
MIN_SDK_VERSION=11
77

8-
VERSION_CODE = 3
8+
VERSION_CODE = 4
99

10-
VERSION_NAME=0.2.1
11-
PUBLISH_VERSION_NAME=0.2.1
10+
VERSION_NAME=0.3.0
1211

13-
GOOGLE_PLAY_VERSION=9.2.1
12+
GOOGLE_PLAY_VERSION=9.4.0
1413
PICASSO_VERSION=2.5.2

library/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apply plugin: 'com.android.library'
33
ext {
44
PUBLISH_GROUP_ID = 'com.github.aryarohit07'
55
PUBLISH_ARTIFACT_ID = 'picasso-facedetection-transformation'
6-
PUBLISH_VERSION = PUBLISH_VERSION_NAME
6+
PUBLISH_VERSION = VERSION_NAME
77
}
88

99
android {

library/src/main/java/com/rohitarya/picasso/facedetection/transformation/FaceCenterCrop.java

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,30 @@
55
import android.graphics.Canvas;
66
import android.graphics.PointF;
77
import android.graphics.RectF;
8+
import android.util.Log;
89
import android.util.SparseArray;
10+
import android.util.TimingLogger;
911

1012
import com.google.android.gms.vision.Frame;
1113
import com.google.android.gms.vision.face.Face;
1214
import com.google.android.gms.vision.face.FaceDetector;
1315
import com.rohitarya.picasso.facedetection.transformation.core.PicassoFaceDetector;
1416
import com.squareup.picasso.Transformation;
1517

16-
/**
17-
* Created by Rohit Arya (http://rohitarya.com) on 19/7/16.
18+
/*
19+
* Copyright (C) 2016 Rohit Arya
20+
*
21+
* Licensed under the Apache License, Version 2.0 (the "License");
22+
* you may not use this file except in compliance with the License.
23+
* You may obtain a copy of the License at
24+
*
25+
* http://www.apache.org/licenses/LICENSE-2.0
26+
*
27+
* Unless required by applicable law or agreed to in writing, software
28+
* distributed under the License is distributed on an "AS IS" BASIS,
29+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
30+
* See the License for the specific language governing permissions and
31+
* limitations under the License.
1832
*/
1933
public class FaceCenterCrop implements Transformation {
2034

@@ -62,6 +76,7 @@ public Bitmap transform(Bitmap original) {
6276
float scaledWidth = width, scaledHeight = height;
6377

6478
PointF focusPoint = new PointF();
79+
6580
detectFace(original, focusPoint);
6681

6782
if (scaleX < scaleY) {

library/src/main/java/com/rohitarya/picasso/facedetection/transformation/core/PicassoFaceDetector.java

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,20 @@
44

55
import com.google.android.gms.vision.face.FaceDetector;
66

7-
/**
8-
* Created by Rohit Arya (http://rohitarya.com) on 19/7/16.
7+
/*
8+
* Copyright (C) 2016 Rohit Arya
9+
*
10+
* Licensed under the Apache License, Version 2.0 (the "License");
11+
* you may not use this file except in compliance with the License.
12+
* You may obtain a copy of the License at
13+
*
14+
* http://www.apache.org/licenses/LICENSE-2.0
15+
*
16+
* Unless required by applicable law or agreed to in writing, software
17+
* distributed under the License is distributed on an "AS IS" BASIS,
18+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19+
* See the License for the specific language governing permissions and
20+
* limitations under the License.
921
*/
1022
public class PicassoFaceDetector {
1123

@@ -24,7 +36,6 @@ public static void initialize(Context context) {
2436
throw new IllegalArgumentException("Context must not be null.");
2537
}
2638
mContext = context.getApplicationContext(); // To make it independent of activity lifecycle
27-
initDetector();
2839
}
2940

3041
private static void initDetector() {

0 commit comments

Comments
 (0)