PhotoML is an Android App to demonstrate on-device FirebaseVision ML-Kit Tasks like Label detection, Optical Character Recognition/Text Recognition, Face detection and Barcode scanning on images selected from in-built gallery viewer without having to upload the image from device for every new image. The app supports both portrait and landscape layouts.
Download from here.
Clone this repository and import into Android Studio
git clone https://github.com/baijudodhia/photoml.git
The app requires Read-only Storage permissions Add the following code in the AndroidManifest.xml file to access Storage
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
- Go to Firebase Console
- Sign in with your google account.
- Add new project > Enter project name > Skip analytics > Create project.
- Add Android App > Enter details > Register App.
- Download google-services.json file and follow the setup to place file in your project to get started.
- Add the following dependencies in the build.gradle (Module:Project) file
- Firebase dependency
classpath 'com.google.gms:google-services:4.3.3'
- Add the following dependencies in the build.gradle (Module:App) file
- Apply Firebase plugin
apply plugin: 'com.google.gms.google-services'
- Android dependencies
//AndroidX dependencies
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
//Material Design Dependency
implementation "com.google.android.material:material:1.1.0"
- 3rd Party dependencies
//RecyclerView Dependencies
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
//Glide Dependencies
implementation 'com.github.bumptech.glide:glide:4.11.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
//PhotoView Dependency for auto image zooming and double tap and pinch zoom replacing ImageView
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
- Firebase dependencies
//Firebase ML-Kit general dependency, also used for OCR and Barcode
implementation 'com.google.firebase:firebase-ml-vision:24.0.3'
//Firebase ML-Kit recongnize and label images dependency works along with general dependency
implementation 'com.google.firebase:firebase-ml-vision-image-label-model:20.0.1'
//Firebase ML-Kit face detection dependency works along with general dependency
implementation 'com.google.firebase:firebase-ml-vision-face-model:20.0.1'
All assets belong to their respective owners. A list of reference is provided to all the assets.