towhee-io / towhee

Towhee is a framework that is dedicated to making neural data processing pipelines simple and fast.
https://towhee.io
Apache License 2.0
3.21k stars 247 forks source link

[Documentation]: How to get embeddings with CVNet #2694

Closed Jia-py closed 6 months ago

Jia-py commented 6 months ago

Is there an existing issue for this?

What kind of documentation would you like added or changed?

The documentation on the website seems out of date. Some APIs are different now.

I find it challenging to generate embeddings with newly added models (e.g., CVNet).

Why is this needed?

No response

Anything else?

No response

junjiejiangjjj commented 6 months ago

All supported models are there: https://huggingface.co/timm


from towhee import pipe, ops, DataCollection

p = (
    pipe.input('path')
    .map('path', 'img', ops.image_decode.cv2())
    .map('img', 'vec', ops.image_embedding.timm(model_name={model_name}))
    .output('img', 'vec')
)