logo
Browse Source

update readme

Signed-off-by: junjie.jiang <junjie.jiang@zilliz.com>
main
junjie.jiang 1 year ago
parent
commit
acbd6f6776
  1. 8
      README.md

8
README.md

@ -18,6 +18,7 @@ Read data from sqlite or mysql.
### Example
```python
from towhee import DataLoader, pipe, ops
p = (
pipe.input('image_path')
@ -27,11 +28,14 @@ p = (
)
for data in DataLoader(ops.data_source.sql('sqlite:///./sqlite.db')):
# table cols: id, image_path, label
for data in DataLoader(ops.data_source.sql('sqlite:///./sqlite.db', 'image_table'), parser=lambda x: x[1]):
print(p(data).to_list(kv_format=True))
# batch
for data in DataLoader(ops.data_source.sql('sqlite:///./sqlite.db'), batch_size=10):
for data in DataLoader(ops.data_source.sql('sqlite:///./sqlite.db', 'image_table'), parser=lambda x: x[1], batch_size=10):
p.batch(data)
```

Loading…
Cancel
Save