towhee
/
image-embedding-resnet50
copied
shiyu22
2 years ago
1 changed files with 3 additions and 8 deletions
@ -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…
Reference in new issue