towhee
/
image-embedding-resnet50
copied
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Readme
Files and versions
21 lines
467 B
21 lines
467 B
2 years ago
|
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')
|
||
|
)
|