pytorch / pytorch/vision

Move TorchVision App Demo to `pytorch_android_lite`

Open
#4,953 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement module: models topic: mobile
Dominant language
Python
Stars
17.9k
Forks
7.3k
Avg merge
1d 15h
Merged PRs (30d)
13

Description

🚀 The feature

Currently we depend our Android Demo app depends on pytorch_android. It's recommended to switch to pytorch_android_lite.

Transitioning to the lite version requires us to update the following things:

  • Change the exported file from frcnn_mnetv3.pt to frcnn_mnetv3.ptl
  • Export the fasterrcnn_mobilenet_v3_large_320_fpn model using _save_for_lite_interpreter()
  • Update the dependencies to org.pytorch:pytorch_android_lite and org.pytorch:pytorch_android_torchvision_lite
  • Replace Module.load() with LiteModuleLoader.load() on the code-base
Motivation, pitch

The recommended dependency for mobile is pytorch_android_lite.

Alternatives

No response

Additional context

There are a few bugs that block this at the moment:

  • The release pipeline for pytorch_android is buggy. The -SNAPSHOT version contains only the _lite binaries and there is no snapshots for pytorch_android_lite.
  • There seems to be a bug on the serialization mechanism that exports the model. See https://github.com/pytorch/pytorch/issues/68536

cc @IvanKobzarev

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Android Demo, its model-export code, dependency declarations, and uses of Module.load(). Check the release-pipeline and serialization blockers, including issue #68536, before making the transition. Done means the demo exports the .ptl model, uses the lite dependencies and loader, and builds successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, python
Domain
machine-learning, mobile-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.