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

Updated 2 years ago

towhee

Image Embedding Pipeline with Resnet50

Authors: derekdqc, shiyu22

Overview

This pipeline is used to extract the feature vector of the image. First step is to normalize the image, and then use resnet50 model to generate the vector.

Interface

Args:

​ img_tensor(PIL.Image):

​ The image to be encoded.

Returns:

​ (Tuple[('cnn', numpy.ndarray)])

​ The embedding of the image.

How to use

  1. Install Towhee
$ pip3 install towhee

You can refer to Getting Started with Towhee for more details. If you have any questions, you can submit an issue to the towhee repository.

  1. Run it with Towhee
>>> from towhee import pipeline
>>> from PIL import Image

>>> img = Image.open('path/to/your/image') # for example, './test_data/test.jpg'
>>> embedding_pipeline = pipeline('towhee/image-embedding-resnet50')
>>> embedding = embedding_pipeline(img)

How it works

You can learn the pipeline and operator in Towhee architecture. This pipeline includes two main functions: towhee/transform-image and towhee/resnet50-image-embedding. It is necessary to ensure that the input and output of the four Operators correspond to each other, and the input and output data types can be defined by DataFrame.

img

shiyu22 5c97d41ff1 Update 14 Commits
folder-icon readme_res Update 2 years ago
file-icon .gitignore
3.0 KiB
download-icon
update unittest 2 years ago
file-icon README.md
1.5 KiB
download-icon
Update 2 years ago
file-icon image_embedding_resnet50.yaml
2.1 KiB
download-icon
update unittest 2 years ago