logo
Browse Source

remove autoconfig

Signed-off-by: shiyu22 <shiyu.chen@zilliz.com>
main
shiyu22 2 years ago
parent
commit
8c76aa4bdc
  1. 11
      image_embedding_resnet50.py

11
image_embedding_resnet50.py

@ -1,15 +1,10 @@
from towhee import pipe, ops, AutoPipes, AutoConfig
@AutoConfig.register
class ImageEmbeddingConfig:
def __init__(self):
self.model = 'resnet50'
from towhee import pipe, ops, AutoPipes
@AutoPipes.register @AutoPipes.register
def ImageEmbedding(config):
def ImageEmbedding():
return ( return (
pipe.input('path') pipe.input('path')
.map('path', 'img', ops.image_decode()) .map('path', 'img', ops.image_decode())
.map('img', 'embedding', ops.image_embedding.timm(model_name=config.model))
.map('img', 'embedding', ops.image_embedding.timm(model_name='resnet50'))
.output('embedding') .output('embedding')
) )
Loading…
Cancel
Save