{"id":25052350,"url":"https://github.com/haturusinghe/cnn-age-gender-detection-android","last_synced_at":"2026-02-25T13:05:58.345Z","repository":{"id":141369229,"uuid":"420976331","full_name":"haturusinghe/cnn-age-gender-detection-android","owner":"haturusinghe","description":"An Android application that uses TensorFlow Lite models (CNN) to detect age and gender from images using the device camera (realtime) or gallery images.","archived":false,"fork":false,"pushed_at":"2025-01-09T03:51:30.000Z","size":3730,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-14T08:07:04.268Z","etag":null,"topics":["cnn","convolutional-neural-networks","kotlin-android","tensorflow","tensorflow-lite"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/haturusinghe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-25T10:22:47.000Z","updated_at":"2025-01-09T03:51:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"e9b37425-a5cb-4e2d-b130-347dbc393e97","html_url":"https://github.com/haturusinghe/cnn-age-gender-detection-android","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haturusinghe%2Fcnn-age-gender-detection-android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haturusinghe%2Fcnn-age-gender-detection-android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haturusinghe%2Fcnn-age-gender-detection-android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haturusinghe%2Fcnn-age-gender-detection-android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/haturusinghe","download_url":"https://codeload.github.com/haturusinghe/cnn-age-gender-detection-android/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248843831,"owners_count":21170488,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cnn","convolutional-neural-networks","kotlin-android","tensorflow","tensorflow-lite"],"created_at":"2025-02-06T10:29:19.027Z","updated_at":"2026-02-25T13:05:58.302Z","avatar_url":"https://github.com/haturusinghe.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TensorFlow Lite Age and Gender Detection Android App\n\nAn Android application that uses TensorFlow Lite models to detect age and gender from images using the device camera or gallery images.\n\n## Features\n\n- Age and gender detection from:\n  - Device camera captures\n  - Gallery image selection\n- Multiple acceleration options:\n  - CPU inference\n  - GPU acceleration support\n  - NNAPI support for compatible devices\n- Real-time inference time reporting\n- User-friendly interface with:\n  - Camera capture button\n  - Gallery selection button\n  - Model initialization controls\n  - Hardware acceleration toggles\n\n## Technical Stack\n\n- Language: Kotlin\n- ML Framework: TensorFlow Lite\n- Architecture Components:\n  - Coroutines for asynchronous operations\n  - View Binding for UI interactions\n  - TFLite delegates (GPU, NNAPI) for acceleration\n\n## Models\nRefer to my [CNN Age Gender Detection](https://github.com/haturusinghe/cnn-age-gender) repo for model implementations\n\nThe application uses two TensorFlow Lite models:\n- Age Estimation Model (`model_age_vN_nonq.tflite`)\n  - Input size: 200x200 pixels\n  - Output: Normalized age value\n- Gender Classification Model (`model_gender_nonq.tflite`)\n  - Input size: 128x128 pixels\n  - Output: Binary classification [Male, Female]\n\n## Requirements\n\n- Android Studio Arctic Fox or newer\n- Minimum SDK: Android 6.0 (API level 23)\n- Android device with:\n  - Camera\n  - Storage access\n  - (Optional) GPU/NNAPI support for acceleration\n\n## Setup and Installation\n\n1. Clone the repository\n2. Open in Android Studio\n3. Sync Gradle dependencies\n4. Build and run on your device\n\n## Usage Instructions\n\n1. Launch the app\n2. Initialize the models:\n   - Select desired acceleration options (GPU/NNAPI if available)\n   - Click \"Initialize Models\" button\n3. After initialization, use either:\n   - Camera button to take a photo\n   - Gallery button to select an image\n4. View results:\n   - Predicted age\n   - Predicted gender\n   - Inference time for both models\n\n## Permissions\n\n- `CAMERA`: For capturing photos\n- `READ_EXTERNAL_STORAGE`: For gallery image selection\n\n## Project Structure\n\nKey files:\n- `MainActivity.kt`: Main UI and camera/gallery handling\n- `AgeEstimationModel.kt`: Age prediction model wrapper\n- `GenderClassificationModel.kt`: Gender prediction model wrapper\n\n## License\n\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaturusinghe%2Fcnn-age-gender-detection-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhaturusinghe%2Fcnn-age-gender-detection-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaturusinghe%2Fcnn-age-gender-detection-android/lists"}