├── .gitignore
├── Demo_Intro_zh.md
├── README.md
├── README_zh.md
├── app
├── .gitignore
├── album.jks
├── apk
│ ├── app-arm64-v8a-release.apk
│ └── app-armeabi-v7a-release.apk
├── build.gradle
├── libs
│ ├── dlib-release.aar
│ ├── prob_det-dev-release.aar
│ └── processing-release.aar
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── assets
│ ├── demo
│ │ ├── IMG_2701.JPG
│ │ ├── IMG_2702.JPG
│ │ ├── IMG_2703.JPG
│ │ ├── IMG_2708.JPG
│ │ ├── IMG_2709.JPG
│ │ ├── IMG_2710.JPG
│ │ ├── IMG_2711.JPG
│ │ ├── IMG_2712.JPG
│ │ ├── IMG_2738.JPG
│ │ ├── IMG_2740.JPG
│ │ ├── IMG_2741.JPG
│ │ └── d_sample.jpg
│ └── polarr.html
│ ├── ic_launcher-web.png
│ ├── java
│ └── co
│ │ └── polarr
│ │ └── albumsdkdemo
│ │ ├── GroupPhotoAdapter.java
│ │ ├── GroupingActivity.java
│ │ ├── MainActivity.java
│ │ ├── SingleGroupAdapter.java
│ │ ├── entities
│ │ └── GroupingResult.java
│ │ └── utils
│ │ ├── BenchmarkUtil.java
│ │ ├── ExportUtil.java
│ │ ├── FileUtils.java
│ │ ├── ImageRenderUtil.java
│ │ ├── ImageUtil.java
│ │ ├── MemoryCache.java
│ │ └── ScaledImageView.java
│ └── res
│ ├── layout
│ ├── activity_grouping.xml
│ ├── activity_main.xml
│ ├── group_photo_item.xml
│ └── single_group_item.xml
│ ├── mipmap-hdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-mdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xxhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xxxhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── values-zh
│ └── strings.xml
│ ├── values
│ ├── colors.xml
│ ├── ids.xml
│ ├── strings.xml
│ └── styles.xml
│ └── xml
│ └── filepaths.xml
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── release
└── polarr_album_v1.1.17.apk
├── rtdemo
├── .gitignore
├── README.md
├── README_zh.md
├── build.gradle
├── key.jks
├── libs
│ └── processing-release.aar
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── co
│ │ └── polarr
│ │ └── demo
│ │ └── rtfeature
│ │ ├── CameraView.java
│ │ └── MainActivity.java
│ └── res
│ ├── drawable-v24
│ └── ic_launcher_foreground.xml
│ ├── drawable
│ └── ic_launcher_background.xml
│ ├── layout
│ └── activity_main.xml
│ ├── mipmap-anydpi-v26
│ ├── ic_launcher.xml
│ └── ic_launcher_round.xml
│ ├── mipmap-hdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-mdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xxhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xxxhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ └── values
│ ├── colors.xml
│ ├── strings.xml
│ └── styles.xml
├── settings.gradle
└── tflibs
├── arm64-v8a
└── libtensorflow_inference.so
└── armeabi-v7a
└── libtensorflow_inference.so
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | *idea
4 | /local.properties
5 | /.idea/workspace.xml
6 | /.idea/libraries
7 | .DS_Store
8 | /build
9 | /captures
10 | .externalNativeBuild
11 |
--------------------------------------------------------------------------------
/Demo_Intro_zh.md:
--------------------------------------------------------------------------------
1 | # Demo使用说明
2 |
3 | ## 图片评分
4 | 
5 |
6 | ## 图片分组
7 | 
8 |
9 | ## 图片分组结果
10 | 
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # PolarrAlbumAndroidSDK
2 |
3 | *As of January 2025, the public repo of Polarr Album Android SDK is no longer maintained. If you are interested in commercial licensing of the SDK, please reach out to [info@polarr.co](mailto:info@polarr.co)*.
4 |
5 | Polarr Android SDK for Smart Album - Includes photo auto grouping, tagging, rating and etc. The SDK serves as an arsenal for Android developers to leverage deep learning and machine learning to organize and enhance a set of photos. Polarr currently has an iOS App called [Polarr Album+](mailto:hello@polarr.ai) which showcases all functions of the SDK plus some. Feature requests are welcomed.
6 |
7 | This SDK includes a starter project (co.polarr.albumsdkdemo) that calls the Android SDK.
8 |
9 | The minimum Android API Level is 15 (4.0.3).
10 |
11 | ## License
12 | The SDK included in this repository must not be used for any commercial purposes without the direct written consent of Polarr, Inc. The current version of the SDK expires on December 31, 2024. For pricing and more info regarding the full license SDK, please email [hello@polarr.ai](mailto:hello@polarr.ai).
13 |
14 | ## Functionalities
15 | ### Tagging a photo
16 | The SDK performs image classification and produce the top 3 most likely labels for the given photo. It also returns an overall rating value from 1.0 to 5.0 (where 1.0 is the worst and 5.0 is the best), which is based on the following metrics:
17 | - Colorfulness
18 | - Exposure (well-exposed photo or poorly exposed: either under-exposed or over-exposed)
19 | - Clarity (bluriness of the photo)
20 | - Expression (if faces are detected, are they smiling, are the eyes open)
21 |
22 |
23 |
24 |
25 | ### Grouping photos
26 |
27 | Similar photos are grouped together based on their subjects, features, colors, and other metrics.
28 |
29 |
30 |
31 | ## Add dependencies to Gradle
32 | ```groovy
33 | dependencies {
34 | // photo processing lib
35 | compile(name: 'processing-dev-release', ext: 'aar')
36 | // photo detection lib
37 | compile(name: 'prob_det-release', ext: 'aar')
38 | // Tensorflow lib
39 | compile 'org.tensorflow:tensorflow-android:+'
40 | // Face detection lib
41 | compile(name: 'dlib-release', ext: 'aar')
42 | }
43 | ```
44 |
45 | ## Rating photo
46 | Rating a photo file. The score from 1.0 to 5.0.
47 | ### Rating by file path
48 | ```java
49 | String filePath;
50 | boolean isBurst = false;
51 | Map result = Processing.processingFile(context, filePath, isBurst);
52 | ```
53 | ### Rating by bitmap
54 | Need a fit scaled bimap. The max width or height less then 300px. It will resize to 300px if exceeded.
55 | ```java
56 | Bitmap bitmap;
57 | long fileCreateTime; // millisecond.
58 | boolean isBurst = false;
59 | Map featureResult = Processing.processingFile(context, bitmap, fileCreateTime, isBurst);
60 | ```
61 | ### Rating results
62 | ```java
63 | float metric_clarity = (float)result.get("metric_clarity");
64 | float metric_exposure = (float)result.get("metric_exposure");
65 | float metric_colorfulness = (float)result.get("metric_colorfulness");
66 | float metric_emotion = (float)result.get("metric_emotion");
67 |
68 | float rating_all = (float)result.get("rating_all");
69 | ```
70 |
71 | ## Tagging photo
72 | Recognize a photo, get top 3 possible objects from the photo
73 | ```java
74 | // scale photo to 224x224
75 | Bitmap bitmap = ImageUtil.getScaledBitmap(photo.getPath(), 224, 224);
76 | Map taggingResult = TaggingUtil.tagPhoto(context.getAssets(), bitmap);
77 | // marge the result with processing result
78 | result.putAll(taggingResult);
79 | ```
80 |
81 | ## Grouping photos
82 | First, rating and tagging photo to a feature result. Then grouping the feature results.
83 | ### Feature a photo
84 | Join rating result and tagging result.
85 | ```java
86 | String filePath;
87 | boolean isBurst = false;
88 | Map featureResult = Processing.processingFile(context, filePath. isBurst);
89 | Bitmap bitmap = ImageUtil.getScaledBitmap(filePath, 224, 224);
90 | Map taggingResult = TaggingUtil.tagPhoto(getAssets(), bitmap);
91 | featureResult.putAll(taggingResult);
92 | ```
93 | ### Grouping feature results
94 | #### init photo files
95 | ```java
96 | List realPhotos = new ArrayList<>();
97 | ```
98 | #### Get features of photos
99 | ```java
100 | List