Towhee is a flexible machine learning framework currently focused on computing deep learning embeddings over unstructured data.

Related tags

Deep Learningtowhee
Overview

https://towhee.io

X2Vec, Towhee is all you need!

Slack License Language Github Actions Coverage

What is Towhee?

Towhee is a flexible machine learning framework currently focused on computing deep learning embeddings over unstructured data. Built on top of PyTorch and Tensorflow (coming soon™), Towhee provides a unified framework for running machine learning pipelines locally, on a multi-GPU/TPU/FPGA machine (coming soon™), or in the cloud (coming soon™). Towhee aims to make democratize machine learning, allowing everyone - from beginner developers to AI/ML research groups to large organizations - to train and deploy machine learning models.

Key features

  • Easy embedding for everyone: Transform your data into vectors with less than five lines of code.

  • Standardized pipeline: Keep your pipeline interface consistent across projects and teams.

  • Rich operators and models: No more reinventing the wheel! Collaborate and share models with the open source community.

  • Support for fine-tuning models: Feed your dataset into our trainer and get a new model in just a few easy steps.

Getting started

Towhee can be installed as follows:

% pip install -U pip
% pip cache purge
% pip install towhee

Towhee provides pre-built computer vision models which can be used to generate embeddings:

>>> from towhee import pipeline
>>> from PIL import Image

# Use our in-built embedding pipeline
>>> img = Image.open('towhee_logo.png')
>>> embedding_pipeline = pipeline('image-embedding')
>>> embedding = embedding_pipeline(img)

Your image embedding is now stored in embedding. It's that simple.

Custom machine learning pipelines can be defined in a YAML file and uploaded to the Towhee hub (coming soon™). Pipelines which already exist in the local Towhee cache (/$HOME/.towhee/pipelines) will be automatically loaded:

# This will load the pipeline defined at $HOME/.towhee/pipelines/fzliu/resnet50_embedding.yaml
>>> embedding_pipeline = pipeline('fzliu/resnet50_embedding')
>>> embedding = embedding_pipeline(img)

Dive deeper

Towhee architecture

  • Pipeline: A Pipeline is a single machine learning task that is composed of several operators. Operators are connected together internally via a directed acyclic graph.

  • Operator: An Operator is a single node within a pipeline. It contains files (e.g. code, configs, models, etc...) and works for reusable operations (e.g., preprocessing an image, inference with a pretrained model).

  • Engine: The Engine sits at Towhee's core, and drives communication between individual operators, acquires and schedules tasks, and maintains CPU/GPU/FPGA/etc executors.

Design concepts

  • Flexible: A Towhee pipeline can be created to implement any machine learning task you can think of.

  • Extensible: Individual operators within each pipeline can be reconfigured and reused in different pipelines. A pipeline can be deployed anywhere you want - on your local machine, on a server with 4 GPUs, or in the cloud (coming soon™)

  • Convenient: Operators can be defined as a single function; new pipelines can be constructed by looking at input and output annotations for those functions. Towhee provides a high-level interface for creating new graphs by stringing together functions in Python code.

Comments
  • [Bug]: The engine died and cant be restarted

    [Bug]: The engine died and cant be restarted

    Is there an existing issue for this?

    • [X] I have searched the existing issues

    Current Behavior

    In multiprocessing on CentOS,in sub process cannot start the engine, but on MacOS, the sub code is running OK.
    torch.device("cuda" if torch.cuda.is_available() else "cpu")
    pp = pipeline('towhee/image-embedding-resnet50')
    
    ### Expected Behavior
    
    on Centos in sub process pipeline run.
    
    ### Steps To Reproduce
    
    _No response_
    
    ### Environment
    
    ```markdown
    - Towhee version(e.g. v0.1.3 or 8b23a93):0.6.1
    - OS(Ubuntu or CentOS):CentOS
    - CPU/Memory:
    - GPU: GeForce RTX 3090
    - Others:
    

    Anything else?

    No response

    stale kind/bug 
    opened by angelapytao 28
  • [Bug]: Pytorchvideo: fail to load mvit model with provided weights

    [Bug]: Pytorchvideo: fail to load mvit model with provided weights

    Is there an existing issue for this?

    • [X] I have searched the existing issues

    Current Behavior

    when running the code,

    import towhee
    
    (
        towhee.glob('datasets/1.mp4')
              .video_decode.ffmpeg()
              .video_classification.video_classification(model_name='mvit_base_16x4', return_vec=True)
    )
    

    some errors are occurred:

    [Errno 2] No such file or directory: '/root/.towhee/hub/video-decode/ffmpeg/main/ffmpeg.py'
    
    During handling of the above exception, another exception occurred:
    ...
    ...
    ...
    /root/.towhee/hub/video-decode/ffmpeg/main/video_decoder.py in <module>()
          9 import numpy as np
         10 
    ---> 11 from towhee.types.video_frame import VideoFrame
         12 from towhee.operator.base import PyOperator
         13 
    
    ModuleNotFoundError: No module named 'towhee.types.video_frame'
    
    

    Environment

    - Towhee version(e.g. v0.1.3 or 8b23a93):v0.6.1
    - OS(Ubuntu or CentOS):Ubuntu16.04
    
    kind/bug 
    opened by aiot-tech 24
  • [Bug]:  Image read exception

    [Bug]: Image read exception

    Is there an existing issue for this?

    • [X] I have searched the existing issues

    Current Behavior

    Read the images:

    555798_8f802d268330d51b2d2410062a6d0209

    errors:

    image

    import os
    import towhee
    
    class Resnet50:
        """
        Say something about the ExampleCalass...
    
        Args:
            args_0 (`type`):
            ...
        """
    
        def resnet50_extract_feat(self, img_path):
            feat = towhee.glob(img_path) \
                .image_decode() \
                .image_embedding.timm(model_name='resnet50') \
                .tensor_normalize() \
                .to_list()
            return feat[0]
    
        def bulk_resnet50_extract_feat(self, imgs_dir, num=100, is_del=True):
            feat = towhee.glob['path'](f'{imgs_dir}/*.jpg').head(num).image_decode['path', 'img']() \
                .image_embedding.timm['img', 'vec'](model_name='resnet50') \
                .tensor_normalize['vec', 'vec']().select['path', 'vec']()
            feat_list = feat.to_list()  # [<Entity dict_keys(['path', 'vec'])>, <Entity dict_keys(['path', 'vec'])>]
            vectors = []
            vectors_ids = []
            for i in feat_list:
                img_path = i.path
                file_name = os.path.split(img_path)[-1]
                v_id = file_name.split("_")[0]
                vectors.append(i.vec)
                vectors_ids.append(int(v_id))
                if is_del and os.path.exists(img_path):
                    os.remove(img_path)
            return vectors, vectors_ids
    

    Expected Behavior

    No response

    Steps To Reproduce

    No response

    Environment

    - Towhee version(e.g. v0.1.3 or 8b23a93):  0.6.0
    - OS(Ubuntu or CentOS): ubuntu
    - CPU/Memory: 16c/62G
    - GPU: GeForce RTX 2070
    - Others:
    

    Anything else?

    No response

    kind/bug needs-triage 
    opened by zhenzi0322 19
  • towhee的输入可以是二进制数据么?

    towhee的输入可以是二进制数据么?

    Is there an existing issue for this?

    • [X] I have searched the existing issues.

    Is your feature request related to a problem? Please describe.

    通关查看相关例子,发现图像、视频提取特征的输入基本都是path,但我的实际场景很多输入都是图像、视频的url,但我又不想落盘下载到本地,请问towhee支持输入url或者下载的二进制数据么?

    Describe the solution you'd like.

    No response

    Describe an alternate solution.

    No response

    Anything else? (Additional Context)

    No response

    stale kind/feature 
    opened by yfq512 18
  • [Bug]: no module named numpy

    [Bug]: no module named numpy

    Is there an existing issue for this?

    • [x] I have searched the existing issues

    Current Behavior

    When I use

    from towhee import pipeline
    

    it throws me an error

    no module name numpy
    

    Expected Behavior

    from towhee import pipeline
    

    It should not throw an error when I use from towhee import pipeline

    Steps To Reproduce

    1. Install NumPy when installing the towhee module can fix this issue
    
    in the requirements.txt file add the NumPy dependency
    

    Environment

    - Towhee version(e.g. v0.1.3 or 8b23a93):
    - OS(Windows): Windows 11
    - CPU/Memory:1.76 GHz
    

    Anything else?

    Reproduce Steps

    1. Install NumPy when installing the towhee module can fix this issue

    in the requirements.txt file add the NumPy dependency.

    Assign me to fix this issue

    priority/critical-urgent 
    opened by pravee42 14
  • [Bug]: Crashed when downloading large file with  pipeline

    [Bug]: Crashed when downloading large file with pipeline "towhee/audio-embedding-vggish"

    Is there an existing issue for this?

    • [X] I have searched the existing issues

    Current Behavior

    program is crashed when embedding an audio using pipeline "towhee/audio-embedding-vggish"

    >>> embedding = embedding_pipeline('/Users/binbin/Towhee_projects/example_audio/knife_swinging_WQ.wav')
    2022-01-12 15:21:19,988 - 123145386786816 - thread_pool_task_executor.py-thread_pool_task_executor:77 - ERROR: Traceback (most recent call last):
      File "/Users/binbin/Towhee_projects/towhee-test-env/lib/python3.8/site-packages/towhee/engine/thread_pool_task_executor.py", line 69, in execute
        op = self._op_pool.acquire_op(runner.hub_op_id,
      File "/Users/binbin/Towhee_projects/towhee-test-env/lib/python3.8/site-packages/towhee/engine/operator_pool.py", line 105, in acquire_op
        op = self._op_loader.load_operator(hub_op_id, op_args)
      File "/Users/binbin/Towhee_projects/towhee-test-env/lib/python3.8/site-packages/towhee/engine/operator_loader.py", line 71, in load_operator
        path = fm.get_operator(function)
      File "/Users/binbin/Towhee_projects/towhee-test-env/lib/python3.8/site-packages/towhee/hub/file_manager.py", line 400, in get_operator
        download_repo(author, repo, tag, str(file_path.parent), install_reqs=install_reqs)
      File "/Users/binbin/Towhee_projects/towhee-test-env/lib/python3.8/site-packages/towhee/hub/hub_tools.py", line 320, in download_repo
        git.Repo.clone_from(url=url, to_path=local_dir, branch=tag)
      File "/Users/binbin/Towhee_projects/towhee-test-env/lib/python3.8/site-packages/git/repo/base.py", line 1148, in clone_from
        return cls._clone(git, url, to_path, GitCmdObjectDB, progress, multi_options, **kwargs)
      File "/Users/binbin/Towhee_projects/towhee-test-env/lib/python3.8/site-packages/git/repo/base.py", line 1086, in _clone
        finalize_process(proc, stderr=stderr)
      File "/Users/binbin/Towhee_projects/towhee-test-env/lib/python3.8/site-packages/git/util.py", line 386, in finalize_process
        proc.wait(**kwargs)
      File "/Users/binbin/Towhee_projects/towhee-test-env/lib/python3.8/site-packages/git/cmd.py", line 501, in wait
        raise GitCommandError(remove_password_if_present(self.args), status, errstr)
    git.exc.GitCommandError: Cmd('git') failed due to: exit code(128)
      cmdline: git clone -v --branch=main https://towhee.io/towhee/torch-vggish.git /Users/binbin/.towhee/operators/towhee/torch_vggish/main
      stderr: 'Cloning into '/Users/binbin/.towhee/operators/towhee/torch_vggish/main'...
    POST git-upload-pack (341 bytes)
    POST git-upload-pack (217 bytes)
    error: RPC failed; HTTP 504 curl 22 The requested URL returned error: 504
    fatal: error reading section header 'shallow-info'
    '
    
    2022-01-12 15:21:19,989 - 123145386786816 - thread_pool_task_executor.py-thread_pool_task_executor:78 - ERROR: Cmd('git') failed due to: exit code(128)
      cmdline: git clone -v --branch=main https://towhee.io/towhee/torch-vggish.git /Users/binbin/.towhee/operators/towhee/torch_vggish/main
      stderr: 'Cloning into '/Users/binbin/.towhee/operators/towhee/torch_vggish/main'...
    POST git-upload-pack (341 bytes)
    POST git-upload-pack (217 bytes)
    error: RPC failed; HTTP 504 curl 22 The requested URL returned error: 504
    fatal: error reading section header 'shallow-info'
    '
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/Users/binbin/Towhee_projects/towhee-test-env/lib/python3.8/site-packages/towhee/__init__.py", line 70, in __call__
        out_df = self._pipeline(in_df)
      File "/Users/binbin/Towhee_projects/towhee-test-env/lib/python3.8/site-packages/towhee/engine/pipeline.py", line 97, in __call__
        graph_ctx.join()
      File "/Users/binbin/Towhee_projects/towhee-test-env/lib/python3.8/site-packages/towhee/engine/graph_context.py", line 95, in join
        op.join()
      File "/Users/binbin/Towhee_projects/towhee-test-env/lib/python3.8/site-packages/towhee/engine/operator_context.py", line 144, in join
        runner.join()
      File "/Users/binbin/Towhee_projects/towhee-test-env/lib/python3.8/site-packages/towhee/engine/operator_runner/runner_base.py", line 196, in join
        self._end_event.wait()
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/threading.py", line 558, in wait
        signaled = self._cond.wait(timeout)
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/threading.py", line 302, in wait
        waiter.acquire()
    KeyboardInterrupt
    

    Expected Behavior

    Embedding succesfully.

    Steps To Reproduce

    1. install the latest package: 0.4.1.dev20:
    pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple towhee==0.4.1.dev20
    
    1. run the following code
    from towhee import pipeline
    embedding_pipeline = pipeline('towhee/audio-embedding-vggish')
    embedding = embedding_pipeline('/Users/binbin/Towhee_projects/example_audio/queen_love_of_my_life.wav')
    

    Environment

    - Towhee version(e.g. v0.1.3 or 8b23a93):0.4.1.dev20
    - OS(Ubuntu or CentOS): Mac OS
    - CPU/Memory:
    - GPU:
    - Others:
    

    Anything else?

    Towhee 0.4.0 is OK. (the issue is not on towhee 0.4.0)

    type/feature component/operator 
    opened by binbinlv 14
  • [Feature]: Update notebook for Image animation

    [Feature]: Update notebook for Image animation

    Is there an existing issue for this?

    • [X] I have searched the existing issues.

    Is your feature request related to a problem? Please describe.

    There are some notebooks for reverse image search with the gradio showcase and deploy fastapi with towhee.api, can you update the notebook for Image animation?

    Describe the solution you'd like.

    • Build an image animation engine Run Animegan or Cartoongan to change the style of the image and release the Gradio showcase.

    • Deep dive image animation Set up running pipelines in parallel and deploy fastapi services using towhee.api, it would be better if video animations could be supported.

    Describe an alternate solution.

    No response

    Anything else? (Additional Context)

    No response

    good first issue stale kind/feature 
    opened by shiyu22 12
  • [Bug]: Tried towhee example, found an error

    [Bug]: Tried towhee example, found an error"NameError: name 'param_scope' is not defined"

    Is there an existing issue for this?

    • [X] I have searched the existing issues

    Current Behavior

    https://towhee.readthedocs.io/en/main/data_collection/data_collection.html

    >>> import towhee
    >>> from towhee.functional import DataCollection
    >>> class my_add:
    ...     def __init__(self, val):
    ...         self.val = val
    ...     def __call__(self, x):
    ...         return x+self.val
    ...
    >>> class my_mul:
    ...     def __init__(self, val):
    ...         self.val = val
    ...     def __call__(self, x):
    ...         return x*self.val
    ...
    >>> with param_scope(dispatcher={
    ...         'add': my_add, # register `my_add` as `dc.add`
    ...         'mul': my_mul  # register `my_mul` as `dc.mul`
    ... }):
    ...     dc = DataCollection([1,2,3,4])
    ...     dc.add(1).mul(2).to_list() # call registered operator
    ...
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    NameError: name 'param_scope' is not defined
    

    Expected Behavior

    No response

    Steps To Reproduce

    No response

    Environment

    - Towhee version(e.g. v0.1.3 or 8b23a93):0.5.1.dev69
    - OS(Ubuntu or CentOS):macos
    - CPU/Memory:
    - GPU:
    - Others:
    

    Anything else?

    No response

    kind/bug 
    opened by jingkl 12
  • [Bug]: pipeline

    [Bug]: pipeline""towhee/image-embedding-3ways-ensemble-large-v1"vector data type is not as described in the documentation

    Is there an existing issue for this?

    • [X] I have searched the existing issues

    Current Behavior

    截屏2022-02-22 19 45 11 Actual test results for tensor:
    >>> embedding_pipeline = pipeline('towhee/image-embedding-3ways-ensemble-large-v1')
    >>> embedding = embedding_pipeline(img_path)
    /Users/binbin/.towhee/operators/towhee/embeddings_ensemble_head/main
    >>> embedding
    tensor([0.2866, 1.0398, 0.3912,  ..., 0.1153, 0.6523, 0.0877],
           grad_fn=<LeakyReluBackward1>)
    

    Expected Behavior

    data type should be numpy.ndarray

    Steps To Reproduce

    No response

    Environment

    - Towhee version(e.g. v0.1.3 or 8b23a93):0.4.1.dev75
    - OS(Ubuntu or CentOS):macos
    - CPU/Memory:
    - GPU:
    - Others:
    

    Anything else?

    No response

    kind/bug 
    opened by jingkl 12
  • How set query conditions for

    How set query conditions for "milvus_search"

    Is there an existing issue for this?

    • [X] I have searched the existing issues.

    Is your feature request related to a problem? Please describe.

    yes

    Describe the solution you'd like.

    I have query similar datas from milvus, and it work well

        connections.connect(host=host, port=port)
        default_fields = [
            FieldSchema(name="milvus_id", dtype=DataType.INT64, is_primary=True),
            FieldSchema(name="feature", dtype=DataType.FLOAT_VECTOR, dim=dim),
            FieldSchema(name="time", dtype=DataType.INT64)
        ]
        default_schema = CollectionSchema(fields=default_fields, description="test collection")
    
        collection = Collection(name=field_name, schema=default_schema)
    
        (
            towhee.dc[('milvus_id', 'img_url', 'time')](read_kafka())
                .runas_op['img_url', 'img'](lambda url: [from_pil(url2img_pil(url)), ])
                .action_classification.pytorchvideo['img', ('', '', 'feature')](model_name='x3d_m')
                .runas_op['feature', 'feature'](lambda feature: DataCollection([feature]).tensor_normalize().to_list()[0].tolist())
                .milvus_search['feature', 'result'](collection=collection, limit=10)
                .run()
        )
    

    But how set query conditions for "milvus_search", such as "time > 10"?

    Describe an alternate solution.

        vectors = img2feature('1.jpg')
    
        topK = 10
        search_params = {"metric_type": "L2", "params": {"nprobe": 10}}
    
        res = collection.search(
            [vectors],
            "feature",
            search_params,
            topK,
            "app_id == {} and time > {}".format(8, 10),
            output_fields=["milvus_id"]
        )
    

    我可以设置 " "app_id == {} and time > {}".format(8, 10), " 进行搜索,但是在towhee中怎么添加类似的条件?

    Anything else? (Additional Context)

    No response

    stale kind/feature 
    opened by yfq512 11
  • [Bug]: audio feature extract error

    [Bug]: audio feature extract error

    Is there an existing issue for this?

    • [X] I have searched the existing issues

    Current Behavior

    When running the code below, some errors occur:

    git clone https://github.com/towhee-io/towhee.git
    cd towhee/ 
    python setup.py install --models
    
    In [1]: import tqdm
       ...: from towhee import ops
       ...: 
    
    In [2]: op1 = ops.audio_decode.ffmpeg()
       ...: op2 = ops.audio_embedding.vggish(predict=False, skip_preprocess=True)
       ...: 
    
    In [3]: paths = ["1.wav", "2.wav"]
    
    In [4]: op2(op1(paths[0]))
    

    ModuleNotFoundError                       Traceback (most recent call last)
    /usr/local/python3.7.0/lib/python3.7/site-packages/towhee/engine/operator_loader.py in load_operator_from_path(self, path, arg, kws)
        104             module = importlib.util.module_from_spec(spec)
    --> 105             spec.loader.exec_module(module)
        106 
    
    /usr/local/python3.7.0/lib/python3.7/importlib/_bootstrap_external.py in exec_module(self, module)
    
    /usr/local/python3.7.0/lib/python3.7/importlib/_bootstrap.py in _call_with_frames_removed(f, *args, **kwds)
    
    /root/.towhee/hub/audio-embedding/vggish/main/vggish.py in <module>()
         26 from towhee.operator.base import NNOperator
    ---> 27 from towhee.models.vggish.torch_vggish import VGG
         28 from towhee import register
    
    ModuleNotFoundError: No module named 'towhee.models'
    
    During handling of the above exception, another exception occurred:
    
    ModuleNotFoundError                       Traceback (most recent call last)
    
    /root/.towhee/hub/audio-embedding/vggish/main/__init__.py in <module>()
         13 # limitations under the License.
         14 
    ---> 15 from .vggish import Vggish
         16 
         17 
    
    /root/.towhee/hub/audio-embedding/vggish/main/vggish.py in <module>()
         25 
         26 from towhee.operator.base import NNOperator
    ---> 27 from towhee.models.vggish.torch_vggish import VGG
         28 from towhee import register
         29 from towhee.types.audio_frame import AudioFrame
    
    ModuleNotFoundError: No module named 'towhee.models'
    
    

    Am I doing something wrong?

    Expected Behavior

    No response

    Steps To Reproduce

    No response

    Environment

    - Towhee version(e.g. v0.1.3 or 8b23a93):
    - OS(Ubuntu or CentOS):Ubuntu
    - CPU/Memory:
    - GPU:
    - Others:
    
    pip list | grep towhee
    
    the output is:
    
    towhee               0.7.2
    towhee.models        0.7.3.dev32
    
    
    kind/bug needs-triage 
    opened by aiot-tech 11
  • [Documentation]: 执行效率的Benchmark

    [Documentation]: 执行效率的Benchmark

    Is there an existing issue for this?

    • [X] I have searched the existing issues

    What kind of documentation would you like added or changed?

    pipline算子之前的数据交换存在CPU和GPU互相拷贝吗?

    Why is this needed?

    No response

    Anything else?

    No response

    kind/documentation 
    opened by OMG59E 0
  • [Bug]: Frequent access to github when yolov5 objects are created multiple times.

    [Bug]: Frequent access to github when yolov5 objects are created multiple times.

    Is there an existing issue for this?

    • [X] I have searched the existing issues

    Current Behavior

    When yolov5 objects are created for many times, the python hub load will request github for many times. If github is unstable, the service will exit abnormally

    image image

    Expected Behavior

    No response

    Steps To Reproduce

    No response

    Environment

    - Towhee version(e.g. v0.1.3 or 8b23a93): v0.9.0
    - OS(Ubuntu or CentOS): MacOS
    - CPU/Memory: 4CPU、8G
    - GPU:
    - Others:
    

    Anything else?

    No response

    kind/bug 
    opened by iebing 4
  • [Bug]: AttributeError: 'TimmImage' object has no attribute 'input_schema'

    [Bug]: AttributeError: 'TimmImage' object has no attribute 'input_schema'

    Is there an existing issue for this?

    • [X] I have searched the existing issues

    Current Behavior

    There was an error building the image using the triton script

    image Successfully clone the repo: image-embedding/timm. Traceback (most recent call last): File "/usr/local/bin/triton_builder", line 8, in sys.exit(main()) File "/usr/local/lib/python3.8/dist-packages/towhee/serve/triton/builder.py", line 208, in main if not Builder(dag, model_root).build(): File "/usr/local/lib/python3.8/dist-packages/towhee/serve/triton/builder.py", line 194, in build if not self.load(): File "/usr/local/lib/python3.8/dist-packages/towhee/serve/triton/builder.py", line 179, in load config = self._create_node_config(node_id, node) File "/usr/local/lib/python3.8/dist-packages/towhee/serve/triton/builder.py", line 149, in _create_node_config return self._pyop_config(op, node_id, node) File "/usr/local/lib/python3.8/dist-packages/towhee/serve/triton/builder.py", line 117, in _pyop_config converter = PyOpToTriton(op, self._model_root, model_name, File "/usr/local/lib/python3.8/dist-packages/towhee/serve/triton/to_triton_models.py", line 146, in init super().init(op, model_root, model_name, op_config) File "/usr/local/lib/python3.8/dist-packages/towhee/serve/triton/to_triton_models.py", line 91, in init self._inputs = TritonModelConfigBuilder.get_input_schema(self._obj.input_schema()) AttributeError: 'TimmImage' object has no attribute 'input_schema'

    Expected Behavior

    No response

    Steps To Reproduce

    No response

    Environment

    - Towhee version(e.g. v0.1.3 or 8b23a93): 0.9.0
    - OS(Ubuntu or CentOS):Ubuntu
    - CPU/Memory:
    - GPU:
    - Others:
    

    Anything else?

    No response

    kind/bug needs-triage 
    opened by lvmnn 5
  • [Bug]: ImportError: cannot import name 'accelerate' from 'towhee.dc2'

    [Bug]: ImportError: cannot import name 'accelerate' from 'towhee.dc2'

    Is there an existing issue for this?

    • [X] I have searched the existing issues

    Current Behavior

    import towhee (towhee.dc'text' .text_embedding.transformers'text', 'vec' .show())

    Expected Behavior

    No response

    Steps To Reproduce

    No response

    Environment

    - Towhee version(e.g. v0.1.3 or 8b23a93):v0.9.0
    - OS(Ubuntu or CentOS):windows10
    - CPU/Memory:intel i3-8100
    - GPU:
    - Others:
    

    Anything else?

    No response

    kind/bug 
    opened by suforme 7
  • [Feature]: How can I take a bag from pysintaller?

    [Feature]: How can I take a bag from pysintaller?

    Is there an existing issue for this?

    • [X] I have searched the existing issues.

    Is your feature request related to a problem? Please describe.

    I am developing a software which can search photo by photo. I take a software bag from pyinstaller. I want to use software for extract picture to vector and post it to server.(It can speed up time for transmit picture data) When I am running on VS code, it is correct. However, when I was take a bag, it is blocked. What happen?

    import towhee import numpy as np from towhee.types import Image import cv2 from towhee.functional.option import _Reason #图片解压 class ResNet50: def init(self): self.url_pipe = (towhee.dummy_input() .image_decode() .image_embedding.timm(model_name='resnet50') .tensor_normalize() .as_function() ) self.byte_pipe = (towhee.dummy_input() .runas_op(self.decode) .image_embedding.timm(model_name='resnet50') .tensor_normalize() .as_function() )

    def decode(self,content):
        arr = np.asarray(bytearray(content), dtype=np.uint8)
        return Image(cv2.imdecode(arr, -1), 'BGR')
    
    #图片url解压为向量
    def extract_by_url(self, img_path):
        feat = self.url_pipe(img_path)
        if isinstance(feat, _Reason):
            raise feat.exception
        return feat
    
    #图片本地路径解压为向量
    def extract_by_byte(self,img_path):
        with open(img_path,'rb')as f:
            content = f.read()
            vector = self.byte_pipe(content)
            return vector
    

    vector = ResNet50().extract_by_url('https://oss.mingzhouyun.com/test/O1CN01lXr5KC1RtRpHFHot2_!!669642169.jpg') with open('/Users/sulimingzhou/Desktop/明洲云/test_towhee/logs/test.txt','w')as file: file.write(str(vector))

    Describe the solution you'd like.

    I try extract from url and img_byte, both wrong

    Describe an alternate solution.

    No response

    Anything else? (Additional Context)

    No response

    kind/feature 
    opened by sulmz 3
  • How to load the image from the path in batch mode?

    How to load the image from the path in batch mode?

    Is there an existing issue for this?

    • [X] I have searched the existing issues

    Current Behavior

    api.get_image_info_1['text', 'image_path']() .image_load['image_path','img']()

    this code puts all image into memory? Is that right? But if we have 5 million pictures,it must be out of memory.

    Expected Behavior

    None

    Steps To Reproduce

    None
    

    Environment

    - Towhee version(e.g. v0.1.3 or 8b23a93):
    - OS(Ubuntu or CentOS):
    - CPU/Memory:
    - GPU:
    - Others:
    

    Anything else?

    None

    stale kind/bug needs-triage 
    opened by check-777 3
Releases(0.9.0)
Controlling a game using mediapipe hand tracking

These scripts use the Google mediapipe hand tracking solution in combination with a webcam in order to send game instructions to a racing game. It features 2 methods of control

3 May 17, 2022
This repository contains the code for our paper VDA (public in EMNLP2021 main conference)

Virtual Data Augmentation: A Robust and General Framework for Fine-tuning Pre-trained Models This repository contains the code for our paper VDA (publ

RUCAIBox 13 Aug 06, 2022
FaceQgen: Semi-Supervised Deep Learning for Face Image Quality Assessment

FaceQgen FaceQgen: Semi-Supervised Deep Learning for Face Image Quality Assessment This repository is based on the paper: "FaceQgen: Semi-Supervised D

Javier Hernandez-Ortega 3 Aug 04, 2022
Point Cloud Denoising input segmentation output raw point-cloud valid/clear fog rain de-noised Abstract Lidar sensors are frequently used in environme

Point Cloud Denoising input segmentation output raw point-cloud valid/clear fog rain de-noised Abstract Lidar sensors are frequently used in environme

75 Nov 24, 2022
RETRO-pytorch - Implementation of RETRO, Deepmind's Retrieval based Attention net, in Pytorch

RETRO - Pytorch (wip) Implementation of RETRO, Deepmind's Retrieval based Attent

Phil Wang 556 Jan 04, 2023
NDE: Climate Modeling with Neural Diffusion Equation, ICDM'21

Climate Modeling with Neural Diffusion Equation Introduction This is the repository of our accepted ICDM 2021 paper "Climate Modeling with Neural Diff

Jeehyun Hwang 5 Dec 18, 2022
buildseg is a building extraction plugin of QGIS based on PaddlePaddle.

buildseg buildseg is a building extraction plugin of QGIS based on PaddlePaddle. TODO Extract building on 512x512 remote sensing images. Extract build

Yizhou Chen 11 Sep 26, 2022
Implementation of light baking system for ray tracing based on Activision's UberBake

Vulkan Light Bakary MSU Graphics Group Student's Diploma Project Treefonov Andrey [GitHub] [LinkedIn] Project Goal The goal of the project is to imple

Andrey Treefonov 7 Dec 27, 2022
Interpolation-based reduced-order models

Interpolation-reduced-order-models Interpolation-based reduced-order models High-fidelity computational fluid dynamics (CFD) solutions are time consum

Donovan Blais 1 Jan 10, 2022
FindFunc is an IDA PRO plugin to find code functions that contain a certain assembly or byte pattern, reference a certain name or string, or conform to various other constraints.

FindFunc: Advanced Filtering/Finding of Functions in IDA Pro FindFunc is an IDA Pro plugin to find code functions that contain a certain assembly or b

213 Dec 17, 2022
The audio-video synchronization of MKV Container Format is exploited to achieve data hiding

The audio-video synchronization of MKV Container Format is exploited to achieve data hiding, where the hidden data can be utilized for various management purposes, including hyper-linking, annotation

Maxim Zaika 1 Nov 17, 2021
Adds timm pretrained backbone to pytorch's FasterRcnn model

Operating Systems Lab (ETCS-352) Experiments for Operating Systems Lab (ETCS-352) performed by me in 2021 at uni. All codes are written by me except t

Mriganka Nath 12 Dec 03, 2022
A lightweight library designed to accelerate the process of training PyTorch models by providing a minimal

A lightweight library designed to accelerate the process of training PyTorch models by providing a minimal, but extensible training loop which is flexible enough to handle the majority of use cases,

Chris Hughes 110 Dec 23, 2022
Additional environments compatible with OpenAI gym

Decentralized Control of Quadrotor Swarms with End-to-end Deep Reinforcement Learning A codebase for training reinforcement learning policies for quad

Zhehui Huang 40 Dec 06, 2022
Prototypical python implementation of the trust-region algorithm presented in Sequential Linearization Method for Bound-Constrained Mathematical Programs with Complementarity Constraints by Larson, Leyffer, Kirches, and Manns.

Prototypical python implementation of the trust-region algorithm presented in Sequential Linearization Method for Bound-Constrained Mathematical Programs with Complementarity Constraints by Larson, L

3 Dec 02, 2022
Expand human face editing via Global Direction of StyleCLIP, especially to maintain similarity during editing.

Oh-My-Face This project is based on StyleCLIP, RIFE, and encoder4editing, which aims to expand human face editing via Global Direction of StyleCLIP, e

AiLin Huang 51 Nov 17, 2022
Application of K-means algorithm on a music dataset after a dimensionality reduction with PCA

PCA for dimensionality reduction combined with Kmeans Goal The Goal of this notebook is to apply a dimensionality reduction on a big dataset in order

Arturo Ghinassi 0 Sep 17, 2022
Fast Differentiable Matrix Sqrt Root

Fast Differentiable Matrix Sqrt Root Geometric Interpretation of Matrix Square Root and Inverse Square Root This repository constains the official Pyt

YueSong 42 Dec 30, 2022
The code for 'Deep Residual Fourier Transformation for Single Image Deblurring'

Deep Residual Fourier Transformation for Single Image Deblurring Xintian Mao, Yiming Liu, Wei Shen, Qingli Li and Yan Wang News 2021.12.5 Release Deep

145 Jan 05, 2023
Codes and Data Processing Files for our paper.

Code Scripts and Processing Files for EEG Sleep Staging Paper 1. Folder Tree ./src_preprocess (data preprocessing files for SHHS and Sleep EDF) sleepE

Chaoqi Yang 18 Dec 12, 2022