question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

how to use the model on java (not Android)

See original GitHub issue

Is there any example of using the model on java?

I want to get the embeddings, perhaps the code looks like this:

byte[] graphDef = readAllBytesOrExit(Paths.get(modelDir, "facenet-tf-20170512-110547.pb"));
Graph g = new Graph();
g.importGraphDef(graphDef);
Session s = new Session(g);
Tensor<Float> result = s.runner().feed("? ? ?", image).fetch("? ? ?").run().get(0).expect(Float.class);

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:13

github_iconTop GitHub Comments

2reactions
blackredscarfcommented, Mar 9, 2018

Luckily, I guess it

Tensor<Float> result = s.runner()
		.feed("input", image)
		.feed("phase_train", falseTensor)
		.fetch("embeddings").run().get(0).expect(Float.class)
0reactions
tzolovcommented, Sep 18, 2018

It has taken me some time but i’ve managed to put together a Java MTCNN implementation here: https://github.com/tzolov/mtcnn-java

Read more comments on GitHub >

github_iconTop Results From Across the Web

java - How to show model name in android studio when it ...
I tried using this library to grab the device name, as well as the Build class to show me which device is being...
Read more >
How to Use Model-View-ViewModel on Android Like a Pro
My goal in this article is to explain why the Model-View-ViewModel architectural pattern presents a very awkward separation of concerns in ...
Read more >
Deploy Ml model on android | cat dog app - YouTube
this video is all about deploying your machine learning / deep learning model on the Android app using Java language.by using this step...
Read more >
Configure Android Studio - Android Developers
Set the JDK version · Open your project in Android Studio and select File > Settings... > Build, Execution, Deployment > Build Tools...
Read more >
TensorFlow Lite inference
Load and run a model in Java ... The Java API for running an inference with TensorFlow Lite is primarily designed for use...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found