Inception Resnet

pip install vectorhub[encoders-image-tfhub]

Details

Example

#pip install vectorhub[encoders-image-tfhub]
from vectorhub.encoders.image.tfhub import InceptionResnet2Vec
model = InceptionResnet2Vec()
sample = model.read('https://getvectorai.com/assets/hub-logo-with-text.png')
model.encode(sample)

Index and search vectors

Index and search your vectors easily on the cloud using 1 line of code!

username = '<your username>'
email = '<your email>'
# You can request an api_key using - type in your username and email.
api_key = model.request_api_key(username, email)

# Index in 1 line of code
items = ['https://getvectorai.com/_nuxt/img/rabbit.4a65d99.png', 'https://getvectorai.com/_nuxt/img/dog-2.b8b4cef.png', 'https://getvectorai.com/_nuxt/img/dog-1.3cc5fe1.png']
model.add_documents(user, api_key, items)

# Search in 1 line of code and get the most similar results.
model.search('https://getvectorai.com/_nuxt/img/dog-1.3cc5fe1.png')

# Add metadata to your search
metadata = [{'animal': 'rabbit', 'hat': 'no'}, {'animal': 'dog', 'hat': 'yes'}, {'animal': 'dog', 'hat': 'yes'}]
model.add_documents(user, api_key, items, metadata=metadata)

Description

Very deep convolutional networks have been central to the largest advances in image recognition performance in recent years. One example is the Inception architecture that has been shown to achieve very good performance at relatively low computational cost. Recently, the introduction of residual connections in conjunction with a more traditional architecture has yielded state-of-the-art performance in the 2015 ILSVRC challenge; its performance was similar to the latest generation Inception-v3 network. This raises the question of whether there are any benefit in combining the Inception architecture with residual connections. Here we give clear empirical evidence that training with residual connections accelerates the training of Inception networks significantly. There is also some evidence of residual Inception networks outperforming similarly expensive Inception networks without residual connections by a thin margin. We also present several new streamlined architectures for both residual and non-residual Inception networks. These variations improve the single-frame recognition performance on the ILSVRC 2012 classification task significantly. We further demonstrate how proper activation scaling stabilizes the training of very wide residual Inception networks. With an ensemble of three residual and one Inception-v4, we achieve 3.08 percent top-5 error on the test set of the ImageNet classification (CLS) challenge.

Working in Colab

If you are using this in colab and want to save this so you don't have to reload, use:

import os 
os.environ['TFHUB_CACHE_DIR'] = "drive/MyDrive/"
os.environ["TFHUB_MODEL_LOAD_FORMAT"] = "COMPRESSED"