raedle / D2GoExample

D2Go model demo built with PlayTorch and Torchvision ops

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

D2Go Example

The repository contains code for a PlayTorch object detection prototype. The prototype uses a quantized D2Go model for the object detection task and runs on-device. It runs on Android and iOS.

NOTE: This example uses an unreleased version of PlayTorch including a complete PyTorch Mobile Module API.

How was this project bootstrapped?

The project was bootstrapped with the following command:

npx torchlive-cli init D2GoExample

Unused packages were removed.

Run project in emulator or on a device

Prerequisites

Install React Native development depencencies. Follow the instructions for Setting up the development environment as provided on the React Native website.

Install project dependencies

Run yarn install to install the project dependencies.

Start Metro server

Start the Metro server, which is needed to build the app bundle (containing the transpiled TypeScript code in the <PROJECT>/src directory).

yarn start

Android

Build the apk for Android and install and run on the emulator (or on a physical device if connected via USB).

yarn android

See instructions on the React Native website for how to build the app in release variant.

iOS

Install CocoaPod dependencies

(cd ios && pod install)

Build the prototype app for iOS and run it in the simulator.

yarn ios

or use the following command to open the Xcode workspace in Xcode to build and run it.

xed ios/D2GoExample.xcworkspace

See instructions on the React Native website for how to build the app in release scheme.

About

D2Go model demo built with PlayTorch and Torchvision ops


Languages

Language:TypeScript 49.7%Language:Java 24.9%Language:Objective-C 13.8%Language:JavaScript 7.6%Language:Ruby 2.3%Language:Swift 1.0%Language:C 0.8%