logo
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Readme
Files and versions

4.6 KiB

Efficientnet Embedding Operator

Authors: kyle he

Overview

EfficientNets are a family of image classification models, which achieve state-of-the-art accuracy, yet being an order-of-magnitude smaller and faster than previous models[1], which is trained on imagenet dataset.

Interface

__init__(self, model_name: str = 'efficientnet-b7', framework: str = 'pytorch', weights_path: str = None)

Args:

  • model_name:
    • the model name for embedding
    • supported types: str, for example 'efficientnet-b7'
  • framework:
    • the framework of the model
    • supported types: str, default is 'pytorch'
  • weights_path:
    • the weights path
    • supported types: str, default is None, using pretrained weights
__call__(self,  image: 'towhee.types.Image')

Args:

  • image:
    • the input image
    • supported types: towhee.types.Image

Returns:

The Operator returns a tuple Tuple[('feature_vector', numpy.ndarray)] containing following fields:

  • feature_vector:
    • the embedding of the image
    • data type: numpy.ndarray
    • shape: (dim,)

Requirements

You can get the required python package by requirements.txt.

How it works

The towhee/efficientnet-image-embedding Operator implements the function of image embedding, which can add to the pipeline. For example, it's the key Operator named embedding_model within image-embedding-efficientnetb5 and image-embedding-efficientnetb7 pipeline.

Reference

[1].https://github.com/lukemelas/EfficientNet-PyTorch#example-feature-extraction

More Resources

4.6 KiB

Efficientnet Embedding Operator

Authors: kyle he

Overview

EfficientNets are a family of image classification models, which achieve state-of-the-art accuracy, yet being an order-of-magnitude smaller and faster than previous models[1], which is trained on imagenet dataset.

Interface

__init__(self, model_name: str = 'efficientnet-b7', framework: str = 'pytorch', weights_path: str = None)

Args:

  • model_name:
    • the model name for embedding
    • supported types: str, for example 'efficientnet-b7'
  • framework:
    • the framework of the model
    • supported types: str, default is 'pytorch'
  • weights_path:
    • the weights path
    • supported types: str, default is None, using pretrained weights
__call__(self,  image: 'towhee.types.Image')

Args:

  • image:
    • the input image
    • supported types: towhee.types.Image

Returns:

The Operator returns a tuple Tuple[('feature_vector', numpy.ndarray)] containing following fields:

  • feature_vector:
    • the embedding of the image
    • data type: numpy.ndarray
    • shape: (dim,)

Requirements

You can get the required python package by requirements.txt.

How it works

The towhee/efficientnet-image-embedding Operator implements the function of image embedding, which can add to the pipeline. For example, it's the key Operator named embedding_model within image-embedding-efficientnetb5 and image-embedding-efficientnetb7 pipeline.

Reference

[1].https://github.com/lukemelas/EfficientNet-PyTorch#example-feature-extraction

More Resources