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.
The project was bootstrapped with the following command:
npx torchlive-cli init D2GoExample
Unused packages were removed.
Install React Native development depencencies. Follow the instructions for Setting up the development environment as provided on the React Native website.
Run yarn install
to install the project dependencies.
Start the Metro server, which is needed to build the app bundle (containing the transpiled TypeScript code in the <PROJECT>/src
directory).
yarn start
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.
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.