towhee
/
image-embedding-resnet50
copied
Browse Source
Signed-off-by: shiyu22 <shiyu.chen@zilliz.com> Add image_embedding_resnet50.py Signed-off-by: shiyu22 <shiyu.chen@zilliz.com> Add image_embedding_resnet50.py Signed-off-by: shiyu22 <shiyu.chen@zilliz.com>main
shiyu22
2 years ago
1 changed files with 21 additions and 0 deletions
@ -0,0 +1,21 @@ |
|||||
|
from towhee import pipe, ops, AutoPipes, AutoConfig |
||||
|
|
||||
|
@AutoConfig.register |
||||
|
class ImageEmbeddingConfig: |
||||
|
""" |
||||
|
For UT |
||||
|
""" |
||||
|
def __init__(self): |
||||
|
self.model = 'resnet50' |
||||
|
|
||||
|
@AutoPipes.register |
||||
|
def ImageEmbedding(config): |
||||
|
""" |
||||
|
For UT |
||||
|
""" |
||||
|
return ( |
||||
|
pipe.input('path') |
||||
|
.map('path', 'img', ops.image_decode()) |
||||
|
.map('img', 'embedding', ops.image_embedding.timm(model_name=config.model)) |
||||
|
.output('embedding') |
||||
|
) |
Loading…
Reference in new issue