Skip to main content

 

x2vec, Towhee is all you need!

 

Towhee makes it easy to build neural data processing pipelines for AI applications. We provide several hundred models, algorithms, and transformations as standard pipeline building blocks. You can prototype your pipeline with our Pythonic API, and use Towhee to automatically optimize it for production-ready environments.

:art: Various Modalities: We support data processing on different modalities, such as images, videos, text, audio, molecular structures, etc.

:mortar_board: SOTA Models: We provide SOTA models across 5 fields (CV, NLP, Multimodal, Audio, Medical), 15 tasks, 140+ model architectures, 700+ pretrained models. These include BERT, CLIP, ViT, SwinTransformer, MAE, data2vec, etc.

:package: Data Processing: Towhee also provides traditional data processing methods that can be used together with neural network models to help you build practical data processing pipelines. Video decoding, audio slicing, frame sampling, feature vector dimension reduction, model ensemble, and database operations are a small sample of the different operators we provide.

:snake: Pythonic API: Towhee includes a pythonic method-chaining API for describing custom data processing pipelines. We also support schemas, making processing unstructured data as easy as handling tabular data.

What's New

v0.7.1 Jul.1,2022

v0.7.0 Jun.24,2022

v0.6.1 May.13,2022

Getting started

Towhee requires Python 3.6+. Towhee can be installed via pip:

% pip install -U pip  # if you run into installation issues, try updating pip
% pip install towhee 

Try your first Towhee pipeline. In this example, we show how to create a CLIP-based cross modal retrieval pipeline within 15 lines of code.

import towhee

# create image embeddings and build index
(
    towhee.glob['file_name']('./*.png')
          .image_decode['file_name', 'img']()
          .image_text_embedding.clip['img', 'vec'](model_name='clip_vit_b32', modality='image')
          .tensor_normalize['vec','vec']()
          .to_faiss[('file_name', 'vec')](findex='./index.bin')
)

# search image by text
results = (
    towhee.dc['text'](['puppy Corgi'])
          .image_text_embedding.clip['text', 'vec'](model_name='clip_vit_b32', modality='text')
          .tensor_normalize['vec', 'vec']()
          .faiss_search['vec', 'results'](findex='./index.bin', k=3)
          .select['text', 'results']()
)

Learn more examples from Towhee bootcamp

Core Concepts

Towhee is composed of four main building blocks - Operators, Pipelines, DataCollection API and Engine.

  • Operator: An operator is a single building block of neural data processing pipelines. Different implementations of operators are categorized by tasks, with standard task interface. An operator can be a deep learning model, a data processing method, or a Python function.

  • Pipeline: A pipeline is composed of several operators. Operators are connected together as a DAG(directed acyclic graph) to create complex functionalities, such as embedding feature extraction, data tagging, cross modal data understanding, etc.

  • DataCollection: A pythonic and method-chaining style API that for building custom pipelines. Pipelines defined by DataColltion API can be either run on notebook locally for fast prototyping, or converting to image docker with end-to-end optimization for production-ready environments.

  • Engine: The engine sits at Towhee's core. Given a pipeline, the engine will drive dataflow between individual operators, schedule tasks, and monitor compute resource (CPU/GPU/etc) usage. We provide a basic engine within Towhee to run pipelines on a single-instance machine, and Triton-based engine to run pipelines in docker containers.

Contributing

Remember that writing code is not the only way to contribute! Submitting issues, answering questions, and improving documentation are some of the many ways you can join our growing community. Check out our contributing page for more information.

Special thanks goes to these folks for contributing to Towhee, either on Github, our Towhee Hub, or elsewhere:




Looking for a database to store and index your embedding vectors? Check out Milvus.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

towhee-0.7.3-py3-none-any.whl (293.8 kB view details)

Uploaded Python 3

File details

Details for the file towhee-0.7.3-py3-none-any.whl.

File metadata

  • Download URL: towhee-0.7.3-py3-none-any.whl
  • Upload date:
  • Size: 293.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.2

File hashes

Hashes for towhee-0.7.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1dc482ab56ce90b105c8e35013fbc94fdfb2013dacc75c6d5750cc19921a54f2
MD5 61e6ffd999e5d4c3baaa24bee513d298
BLAKE2b-256 5d0a7c9f00e75d2b7476dc5ea297fc489d720e4987b2c5caf2c88c06c94a2010

See more details on using hashes here.

Release history Release notifications | RSS feed

1.1.3

1 file

1.1.2

1 file

1.1.1

1 file

1.1.0

1 file

1.0.0

1 file

0.9.0

1 file

0.8.1

1 file

0.8.0

1 file

This release

0.7.3 This release

1 file

0.7.2

1 file

0.7.1

1 file

0.7.0

1 file

0.6.1

1 file

0.6.0

1 file

0.5.1

1 file

0.5.0

1 file

0.4.0

1 file

0.3.0

1 file

0.2.0

1 file

0.1.3

1 file

0.1.2

1 file

0.1.1

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page