GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - tawhidmonowar/DataDroid: Create image classification datasets on Android & iOS, capture or import images per class, check class balance, & export as zip.

BranchesTags
Open more actions menu

Latest commit

 

History

56 Commits
56 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
androidApp
androidApp
 
 
docs
docs
 
 
gradle
gradle
 
 
iosApp
iosApp
 
 
shared
shared
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
NOTICE
NOTICE
 
 
README.md
README.md
 
 
build.gradle.kts
build.gradle.kts
 
 
gradle.properties
gradle.properties
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
settings.gradle.kts
settings.gradle.kts
 
 

Repository files navigation

DataDroid: build image datasets on your phone, with AI on-device

Kotlin Compose Multiplatform Platforms Android iOS On-device AI

DataDroid is a cross-platform, on-device image dataset studio built with Kotlin Multiplatform and Compose Multiplatform. Create image classification datasets on Android and iOS, capture or import images per class, check class balance, and export a ready-to-train zip.

Everything runs on the device, including the auto-sort model, so no image ever leaves the phone.

Platforms: Android (phone and tablet, Android 7.0+) and iOS (iPhone and iPad, iOS 18.2+).

Contents

  • Features
  • Requirements
  • Run on Android
  • Run on iOS
  • Try the key features
  • Architecture
  • Tests
  • License and attribution

Features

  • Datasets: create, rename, delete; each starts with one class.

  • Classes: add, rename inline, clear, delete. Class names are unique per dataset.

  • Capture: one full-screen camera for the whole dataset. Chips under the square viewfinder choose where images go: Auto, or one class. Tap the shutter for one image, hold it to record (~5 frames/s, 640×640 square, what the viewfinder shows). Photos from the library go the same way. Images can also be added from a folder per class, or imported as a folder or zip of class folders (merged by class name). Originals are kept unchanged; files that aren't decodable images are skipped.

  • Auto-sort: capture without choosing a class. An on-device model (MobileNetV3-Small by default, or MobileNetV3-Large or DINOv2 ViT-S/14, chosen in Settings) embeds each image and saves it to the class whose images it's most like, with a live label over the viewfinder. Images unlike every class wait under Unknown (kept on disk, so closing the camera or the app loses none), where they can start a new class, join an existing one, or be discarded. "Unknown detection" sets how alike an image must be to a class (0 turns it off). Embeddings are cached per dataset and model (embeddings.bin for Small), so each image is only analysed once per model.

  • Review: per class, a progress bar towards 20 images and the newest thumbnails; a gallery with multi-select to move or delete; and a full-screen viewer to swipe through images, zoom, move or delete. Deletes can be undone for a few seconds.

  • Class balance: how many classes are ready, image counts, per-class bars, and warnings for empty, small (<20 images) or imbalanced (largest ≥ 1.5× smallest) classes.

  • Image settings: store images as captured, or resize (fit or square) and convert to JPEG, PNG or WebP, as an app default or per dataset.

  • Export: a zip of the dataset folder, shared through the system share sheet:

    Animal_Dataset/
    ├── metadata.json      {"name": "Animal Dataset", "classes": ["cat", "dog", "bird"], "imageCount": 2438}
    ├── cat/cat_0001.jpg
    ├── dog/dog_0001.png
    └── bird/bird_0001.jpg
    unknown/unknown_0001.jpg
    

    Empty classes are left out. Unknown images, if any, go in an unknown folder beside the dataset folder, not inside it, so a training tool pointed at Animal_Dataset/ doesn't take them for a class; metadata.json names the folder ("unknownFolder": "unknown"). The same zips (or any zip of class folders) can be imported as a new dataset, and their unknown images go back under Unknown.

Requirements

Tool Version Needed for
JDK 17 or newer to start Gradle. Gradle downloads the JDK 21 it runs on (see gradle/gradle-daemon-jvm.properties). Both
Android Studio A recent stable release that supports Android Gradle Plugin 9.4, with Android SDK 37 Android
Android device or emulator Android 7.0 (API 24) or newer. A camera is optional. Android
macOS with Xcode Xcode 26 (the version the project is developed with), with an iOS 18.2+ simulator or device iOS
Internet access On the first build, to download Gradle dependencies and the TensorFlow Lite C framework Both

Clone the repository first:

git clone https://github.com/tawhidmonowar/DataDroid.git
cd DataDroid

Run on Android

From Android Studio

  1. Open the DataDroid folder in Android Studio and wait for the Gradle sync to finish.
  2. Pick the androidApp run configuration and an emulator or a connected device.
  3. Press Run.

From the command line

  1. Connect a device with USB debugging on, or start an emulator.

  2. Build and install the debug app:

    ./gradlew :androidApp:installDebug
  3. Open DataDroid from the launcher.

To build an APK without installing it, run ./gradlew :androidApp:assembleDebug. The APK is written to androidApp/build/outputs/apk/debug/.

The emulator camera works with its virtual scene or a webcam. On a real device, allow camera access when the app asks.

Run on iOS

  1. Open iosApp/iosApp.xcodeproj in Xcode.
  2. Choose the iosApp scheme and an iPhone or iPad simulator.
  3. Press Run.

The first build takes several minutes. Xcode's build phase calls Gradle (:shared:embedAndSignAppleFrameworkForXcode), which compiles the shared Kotlin code and downloads the TensorFlow Lite C framework (:shared:downloadTfliteC) into third_party/. Later builds are incremental.

On a physical iPhone or iPad (needed for the camera, since the simulator has none):

  1. Open iosApp/Configuration/Config.xcconfig and set TEAM_ID to your Apple Developer team ID. A free personal team works. The bundle ID becomes org.onedroid.dataset.DataDroid<TEAM_ID>, so it is unique to you.
  2. Select your device in Xcode and press Run.
  3. If iOS blocks the app, trust your developer certificate in Settings › General › VPN & Device Management.

On the simulator, use the photo library, Import class folders or Import dataset (.zip) to add images instead of the camera. Drag images onto the simulator window to add them to its Photos library.

Try the key features

A two-minute tour, on either platform:

  1. Create a dataset. On the home screen, tap New dataset and give it a name, such as "Desk objects".
  2. Fill two classes. Rename Class 1 to mug and tap Capture. The camera starts on mug: tap the shutter for one image, or hold it to record about 5 frames a second. Tap New class in the chip row, name it pen, and capture some pens. Aim for 20 or more images per class; each class's progress bar fills as you go. The gallery button beside the shutter adds photos from the library instead.
  3. Auto-sort. Tap the Auto chip and point the camera at a mug or a pen. The label over the viewfinder shows the closest class and how similar it is, and captures go straight to that class. Capture something new, like a phone: it waits under Unknown (the badge beside the shutter), where New class turns it into a third class. Photos from the library are sorted the same way while Auto is on.
  4. Watch the class balance. Back on the dataset, the line under the title says how many classes are ready. Tap it for per-class counts and warnings about empty, small or imbalanced classes.
  5. Review. Tap a thumbnail to view images full screen: swipe between them, pinch to zoom, and Move to… or Delete (with Undo). See all opens the gallery; long-press to select several images.
  6. Change image settings. In Settings, choose a size (Original, Fit or Square) and a format (JPEG, PNG or WebP) for new datasets. Use Image settings in a dataset's menu to change it for one dataset.
  7. Export. Tap Export, then Export ZIP, and share the zip through the system share sheet. It holds one folder per class plus metadata.json.
  8. Import. Back on the home screen, use Import dataset (.zip) on the zip you just exported to get it back as a new dataset.

Architecture

Most of the code is shared. About 85% of the app's Kotlin lives in commonMain (roughly 7,200 lines), against about 490 lines in androidMain and 760 in iosMain. The Android and iOS app shells are a few dozen lines each.

A single shared module holds everything, layered by package under org.onedroid.dataset:

Package Contents
domain Result/DataError typed errors, models, repository interfaces (DatasetRepository, ImageSorter, SettingsRepository), use cases (class balance, class matching, name validation, folder grouping, export naming)
data FileDatasetRepository (JSON record + image files per dataset), streaming ZipWriter/ZipReader with a shared CRC-32, exporter/importer, image processing, settings storage, EmbeddingImageSorter
presentation MVI screens (State/Action/Event/ViewModel, Root + Screen composables), theme, components (UiText, ObserveAsEvents, dialogs), type-safe navigation
core.platform expect/actual camera (CameraX / AVFoundation), pickers, share sheet, image codecs, and the image model backbone (LiteRT on Android, the TensorFlow Lite C API through cinterop on iOS)
core.di Koin modules; initKoin is called from DataDroidApplication (Android) and iOSApp.init (iOS)

Only the platform boundaries are written per platform: camera, image decoding and encoding, file and photo pickers, the share sheet, zip inflation, and the model runtime. Image preprocessing for the model (toInputTensor), the embedding cache, and class matching are shared, so both platforms sort images the same way.

Storage: <app files>/datasets/<id>/dataset.json, images/<imageId>.<ext>, thumbs/<imageId>.jpg, embeddings.bin.

Tests

The shared tests in shared/src/commonTest run on both platforms:

  • JVM: ./gradlew :shared:testAndroidHostTest
  • iOS simulator (macOS only): ./gradlew :shared:iosSimulatorArm64Test

License and attribution

DataDroid is licensed under the Apache License 2.0.

It bundles a DINOv2 ViT-S/14 image encoder converted from Meta's DINOv2 (Apache 2.0; conversion script in docs/scripts/export_dinov2.py), and the MobileNetV3-Small and MobileNetV3-Large image embedders from Google MediaPipe (Apache 2.0), uses LiteRT on Android and the TensorFlow Lite C runtime on iOS (Apache 2.0), and includes Material Design icon paths (Apache 2.0). See NOTICE for details and sources.

Author

Tawhid Monowar - Computer Science & Engineering Student
LinkedIn | Portfolio | Email

The contest essay is in ESSAY.md, and the paper on the auto-sort matcher is in docs/paper/paper.md.

About

Create image classification datasets on Android & iOS, capture or import images per class, check class balance, & export as zip.

tawhidmonowar.github.io/DataDroid

Topics

androiddata-engineeringdatasetdataset-generationimage-datasetioskmp

Resources

Readme
Apache-2.0 license
Activity

Stars

1 star

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Sponsor this project

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.