Subtitles section Play video
[MUSIC PLAYING]
SANDEEP GUPTA: Hi.
My name is Sandeep Gupta.
And I'm a product manager in the TensorFlow team.
I'm going to talk to you about TensorFlow Hub.
I am presenting this work on behalf
of my colleague Gus and our Europe-based TF Hub team.
So when you want to apply ML to solve a problem,
you first need a suitable model.
And now, every day, powerful new models
are published in research papers or in blog posts.
So let's say you read about one of these,
and you want to see how great it is,
and you want to try it on your problem.
So you search for more details.
And you might find the model code repository somewhere.
Sometimes the pretrained model is right there.
Sometimes it is stored on some other storage.
Sometimes you may need to download and run a script
to get access to the model.
So as you do this, you have many questions.
How do I use this model?
Is it safe?
How was it trained?
What was the data?
Am I using the correct version?
This is where TensorFlow Hub comes in to help you.
So TFHub.dev is the place for all your TensorFlow model needs
to easily find the latest ready-to-use models
with documentation, code snippets, and much, much more.
So TensorFlow Hub's rich repository of models
covers a wide range of machine learning tasks for all
of your common ML needs.
For example, in image-related tasks,
we have models for image classification, object
detection, image augmentation, and also image generation,
such as for slide style transfers and more.
For text, we have state-of-the-art models like
Bert and Albert.
We have universal sentence encoders
and many more embeddings that can support
a wide range of natural language understanding tasks,
such as question and answering, text classification,
semantic analysis, and many more.
We also have video-related models,
which can help with video action recognition,
such as gestures, and also video generation.
And now we have recently added audio models
for things like pitch detection.
So we invested a lot of energy in making
models in TensorFlow Hub be easily
reusable for composing new models for transfer learning
for your problem.
With one line of code, models can
be put into your TensorFlow 2 code for retraining
with your own data.
Now, this works whether you are using the high level DF.keras
API or the low level APIs.
This can also be used in your training pipelines
through TensorFlow Extended.
Recently, we have added support for models
that are ready to deploy on all platforms
where you use TensorFlow.
These pretrained models have been
prepared for a wide range of environments, which run
across TensorFlow's ecosystem.
For example, you can use TensorFlow GS models
for web and node-based environments.
You can use TensorFlow Lite models
for your mobile and embedded devices.
In TensorFlow Hub, you can also discover ready-to-use models
for the Coral edge TPU devices.
These devices combine TensorFlow Lite models
with a fast and efficient accelerator,
which helps companies create models that perform really
fast inference on the edge.
You can learn more about this platform at Coral.ai.
So today, we have more than 1,000 models
available with documentation, code snippets.
And for some of them, there are also simple demos
that you can try interactively.
These models can be easily found by searching or exploring
the TensorFlow Hub repository.
Now, many TensorFlow Hub models also
have an interactive Colab notebook
that links directly to the model page, which
lets you play with the models with code examples
right from your browser.
And this is all hosted on Google's infrastructure.
So you can be getting started with nothing to install.
So now that we have seen what TensorFlow Hub is,
let's take a look at a couple of examples
and see how it can help you solve your problems.
So the first example I'll show you is about style transfer.
So here, let's take a look at how TensorFlow Hub can
do artistic style transfer that can work on arbitrary painting
styles using generative models.
So let's say you have an image of this yellow labrador shown
here.
And you would like to imagine it in the style
of your favorite painter.
So you can find a style transfer model on TF Hub
as shown at this URL.
And then you import the TensorFlow Hub model.
And you can download this model from the URL
with these lines of code shown here.
And now you have the model is ready for calling inference
on your image.
And you'll get back the stylized image as shown here.
You can get more details of this example
at the URL shown on the bottom.
The second example we'll take a look at
has to do with text classification.
So let's look at how you can use a model
with a layer from TensorFlow Hub that you can use and train
your own model.
So imagine you want to participate
in a Kaggle competition that's related to text classification.
Now for text problems, you usually
start with a text embedding, which
is a way of converting raw text into a more
useful structured numeric representation
that a neural network model can take in.
Now training your own embeddings can
take a lot of time and data.
The good news is that TF Hub has multiple embeddings
in many languages that are ready for your use.
So in TensorFlow Hub, you can pull
any of these pretrained embeddings
with one line of code.
Here, we are importing one of these embeddings
as a Keras model layer, as you see with that last line there.
And now this Keras model layer can
be incorporated in the rest of your TensorFlow 2 model
training code using standard Keras
APIs by adding additional layers and then calling
the model training and the compile and fit functions.
So you can see how easy it is to build a powerful custom text
model on top of a pretrained embedding directly from TF Hub.
Another thing I wanted to highlight
is that TF Hub also helps bring these models to life
in a very interactive way.
So some of our publishers have created custom components
that highlight the amazing work of these models, which
you can try out directly in the browser on your own image
or on your own audio clip without having to download
or install anything.
Before I close, I want to show you
some of the recent improvements and additions
on TensorFlowHub.dev.
So first, as our model collection on TF Hub has grown,
we have greatly improved the search and discovery feature
on TensorFlow Hub to make it easy
for you to find the model that you need.
So you can filter by model type.
You can filter by model formats or deployment targets.
For example, if you need a model to run
on mobile or in the browser, you can find them
easily and quickly.
You can also use these filters to specifically find
models that are fine-tunable on your own data.
Also, we have done a lot of work to support
the variety of TensorFlow deployment formats.
So for TensorFlow Lite, we now support additional metadata
along with the TF Lite model file.
This metadata stores useful information about the model,
such as its version number, its input, output, and also
its class labels, et cetera, which
makes managing these models in your mobile applications
much, much easier.
For TensorFlow.js, we are excited to announce
two new models today for face tracking and hand
tracking, which are built by our media pipe team.
These models enable some really cool interactive web
applications.
And in future, we will be adding more text models for web use
cases.
Lastly, TensorFlow Hub is powered
by the TensorFlow community.
When we first launched TensorFlow Hub,
we used it as a platform for sharing Google authored models.
But now, we are beginning to share models from many more
publishers, such as Microsoft, the Metropolitan Museum,
NVIDIA, and many, many more.
For example, very recently, we completed
a TensorFlow 2.0 Kaggle question answering
challenge competition.
And we are happy to announce that Kaggle
has published all of the winners models on TensorFlow Hub.
Now with over 1,000 state-of-the-art models from
an increasing number of organizations,
you can find models that cover a much wider range of machine
learning tasks and data sets.
So to everyone who has helped contribute models to TF Hub,
a big thank you.
If you are interested in publishing your models,
we are now accepting submissions.
We are in the early stages of building out our third party
model collection.
And our focus is still on adding high quality models
with strong documentation.
And we are very interested in helping
people share the usable pieces of ML models
with the wider world.
So if you would like to share your models,
please visit the link shown here or find it on our website.
So that's it about TF Hub.
Thank you so much for watching.
And with that, I would like to hand it over
to Gal, who will tell us more about Tensor Board.
Thank you.
[MUSIC PLAYING]