TensorFlow Tutorial Step 4: Modify PluginLibrary

Craig Oda
theta360.guide
Published in
2 min readNov 15, 2018

Adapt the RICOH THETA PluginLibrary to work with TensorFlow

Previous Steps

Start

Start tag: WS_START_STEP4

Please reference the GitHub repository at the tag above.

Overview

Call another plug-in (File Cloud Upload) and add the functionality to upload to Google Photos.

Work Content

Follow the embedded comments in “Step 4” from the code on GitHub with the tag above.

Fix plug-in library

  • Enable it to work even if you call startActivityForResult
  • Contents of onResume to onCreate
  • Contents of onPause to onDestroy

How to disable upload to Google Photos

If you want to disable upload to Google Photos, change the following in CameraActivity.java

ENABLE_CLOUD_UPLOAD = false; // in CameraActivity.java

Final Code Tag: WS_END

Case of normal plug-in

  • Completion by itself
  • Initialization with onResume
  • Terminate processing with onPause

Case of Connecting with Another Plug-in

  • Avoid influencing the shooting application as much as possible. When linking with another plug-in, call onStop with startActivityForResult
  • Make sure to terminate the plug-in with the long press of the mode button
  • Do not perform background processing at onPause()
  • Terminate HandlerThread

Review of Key Points from the TensorFlow Tutorial Series

When using the Camera API

sendBroadcast(new Intent("com.theta360.plugin.ACTION_MAIN_CAMERA_CLOSE"));Camera.Parameters.set("RIC_SHOOTING_MODE", "RicMoviePreview1024");

When using the THETA Microphone

AudioManager.setParameters("RicUseBFormat=false");

Application Ideas

  • computational photography
  • Edge computing
  • Machine learning
  • IoT

--

--

Craig Oda
theta360.guide

open source advocate, writer, Flutter developer, father, husband, fly fisherman, surfer