-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If I use moganet to train a model, and then use the model for feature extraction and image retrieval, how should I apply this framework? #2699
Comments
hi @goldwater668 , towhee integrates image models through timm. If your model can be called through timm, use the following code: from towhee import pipe, ops, DataCollection
p = (
pipe.input('path')
.map('path', 'img', ops.image_decode())
.map('img', 'vec', ops.image_embedding.timm(model_name='model_name', checkpoint_path="your local weights"))
.output('img', 'vec')
)
DataCollection(p('towhee.jpeg')).show() If not, you need to implement an operator yourself, https://towhee.readthedocs.io/en/latest/operator/usage.html#custom-operators |
@junjiejiangjjj
|
It seems that you need to run it in the directory of this project. git clone https://github.com/Westlake-AI/MogaNet
cd MogaNet import models
from towhee import pipe, ops, DataCollection
p = (
pipe.input('path')
.map('path', 'img', ops.image_decode())
.map('img', 'vec', ops.image_embedding.timm(model_name='moganet_xtiny', checkpoint_path="your local weights"))
.output('img', 'vec')
)
DataCollection(p('towhee.jpeg')).show() |
hi @goldwater668 , if you change the channels, you also need to change it when initializing the model. |
Towhee accelerates model inference through Triton Server , but only supports a subset of models. For your own models, you can consider converting them to ONNX to accelerate inference. |
@junjiejiangjjj |
Is there an existing issue for this?
Is your feature request related to a problem? Please describe.
If I use moganet to train a model, and then use the model for feature extraction and image retrieval, how should I apply this framework?
Describe the solution you'd like.
If I use moganet to train a model, and then use the model for feature extraction and image retrieval, how should I apply this framework?
Describe an alternate solution.
If I use moganet to train a model, and then use the model for feature extraction and image retrieval, how should I apply this framework?
Anything else? (Additional Context)
If I use moganet to train a model, and then use the model for feature extraction and image retrieval, how should I apply this framework?
The text was updated successfully, but these errors were encountered: