Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TensorFlow Lite Support #1

Merged
merged 5 commits into from
May 21, 2020
Merged

TensorFlow Lite Support #1

merged 5 commits into from
May 21, 2020

Conversation

adiazulay
Copy link
Contributor

Adds support for TensorFlow Lite, and keeps it inactive.

Fixes bugs.

self.__tflite_predict_fn =\
tflite.Interpreter(model_path=self.__model_path)

def __sort_predictions(self, confidences, labels):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can include this in PredictionResult, so results for all types come back sorted

# Add an extra axis onto the numpy array
np_image = np.expand_dims(image, axis=0)

# Converts to floating point and standardize range from -1 to 1.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe Lobe's TF model range is 0 to 1. Are TF Lite models different?

@shawncal shawncal merged commit bd01ace into lobe:master May 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants