logo
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

Updated 1 year ago

data-source

glob

author: junjie.jiang


Desription

Wrapper of python glob.glob

The parameters are consistent with it.


Code Example

Example

from towhee import DataLoader, pipe, ops
p = (
    pipe.input('image_path')
    .map('image_path', 'image', ops.image_decode.cv2())
    .map('image', 'vec', ops.image_embedding.timm(model_name='resnet50'))
    .output('vec')

)

for data in DataLoader(ops.data_source.glob('./*.jpg')):
    print(p(data).to_list(kv_format=True))

# batch
for data in DataLoader(ops.data_source.glob('./*.jpg'), batch_size=10):
    p.batch(data)
junjie.jiang fb600ef45a Add glob 2 Commits
file-icon .gitattributes
1.1 KiB
download-icon
Initial commit 1 year ago
file-icon README.md
608 B
download-icon
Add glob 1 year ago
file-icon __init__.py
97 B
download-icon
Add glob 1 year ago
file-icon path_glob.py
348 B
download-icon
Add glob 1 year ago