towhee
towhee copied to clipboard
[Feature]: Is there any way to get towhee to support batch processing of images
Example:
import towhee
class Resnet50:
"""
Say something about the ExampleCalass...
Args:
args_0 (`type`):
...
"""
def resnet50_extract_feat(self, img_path):
feat = towhee.glob(img_path) \
.image_decode() \
.image_embedding.timm(model_name='resnet50') \
.tensor_normalize() \
.to_list()
return feat[0]
Towhee support batch interface to run the data in batch, you can refer to this. Is this interface what you want?
BTW, if you want to processing batch images, you can set the img_path as the paths matching a pathname pattern, such as towhee.glob('all_img/*.jpg', 'all_img/*.png'). And set_parallel interface will help to process image in multi parallel.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Rotten issues close after 30d of inactivity. Close the stale issues and pull requests after 7 days of inactivity. Reopen the issue with /reopen.