← all repositories
pytorch/android-demo-app

PyTorch Mobile's last will and testament, in 12 Android apps

A museum of on-device ML demos from image classification to streaming ASR, now frozen in time.

android-demo-app
Velocity · 7d
+0.6
★ / day
Trend
steady
star history

What it does This repo collects a dozen Android sample apps showing how to run PyTorch models on-device: image classification, object detection (YOLOv5), image segmentation (DeepLabV3), speech recognition (wav2vec 2.0), streaming ASR, machine translation, question answering, video classification, and more. Each demo pairs a Python conversion script with a working Android app.

The interesting bit The breadth is the point. You can trace how PyTorch Mobile handled everything from a simple MNIST Vision Transformer to a Java Native Call into C++ for real-time mel spectrograms. It’s a snapshot of mid-2020s mobile ML ambitions before the platform itself was sunset.

Key highlights

  • Covers 12 distinct ML tasks across vision, text, audio, and video
  • Includes model conversion scripts (TorchScript, quantization, etc.) alongside Android code
  • Shows integration with camera, photo library, live audio, and video playback
  • D2Go demo uses native pre-built torchvision-ops library
  • Streaming ASR demo uses JNI to C++ for audio processing

Caveats

  • PyTorch Mobile is no longer actively supported; the README itself redirects to ExecuTorch
  • Some demos reference specific PyTorch 1.8 APIs that are now dated
  • README has a duplicated “Speech recognition” section, suggesting light maintenance

Verdict Worth browsing if you’re maintaining legacy PyTorch Mobile code or studying how on-device ML was pitched circa 2021–2023. Skip it if you’re starting fresh; follow the README’s own advice and use ExecuTorch instead.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.