Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ...
- public class MainActivity extends AppCompatActivity {
- ...
- private TensorFlowInferenceInterface mInferenceInterface;
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- mInferenceInterface = new TensorFlowInferenceInterface(getAssets(), "file:///android_asset/optimized_tfdroid.pb");
- ...
- float[] inputFloats = {1, 1, 1};
- mInferenceInterface.feed("I", inputFloats, 1, 3);
- mInferenceInterface.run(new String[]{"O"});
- float[] resu = {0, 0};
- mInferenceInterface.fetch("O", resu);
- ...
- }
- ...
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement