tf-datachain
tf-datachain is a local dataset loader based on tf.data input pipeline. It handles the job of reading and encoding data direct in your disk and simplify the processing by providing several predefined methods.
Object Detection
from tf_datachain import ObjectDetection as od
Before using ObjectDetection functions, you have to define some basic information, like folder path and class name list.
od.imageFolder = "data/images"
# hard-code class names
od.classNames = ["class1", "class2", "class3"]
# or read them from csv file
import pandas as pd
od.classNames = pd.read_csv("class.csv", header=None).iloc[:,0].values.tolist()
Then, a ready-to-use tf.data input pipeline can be built within 3 steps:
- Preparation: prepare the list to process without reading content.
- Data Loading: load data from prepared list via
tf.data. - Augmentation: shuffle, batch, and resize.
The best practices to load dataset with different format are shown below.
Pascal VOC XML Format
from tf_datachain.utils import split
BATCH_SIZE = 4
# read .xml file within data/annotaions folder
# then split them with the ratio of 6:2:2
trainDataset, validationDataset, testDataset = split(od.prepareAnnotation("data/annotations", ".xml"), 6, 2, 2)
trainDataset = tf.data.Dataset.from_tensor_slices(trainDataset)
trainDataset = trainDataset.map(lambda data: od.loadData(data, "Pascal VOC XML", "xyxy"), num_parallel_calls=tf.data.AUTOTUNE)
# shuffle, ragged batch, and jittered resize
trainDataset = od.datasetProcessing(trainDataset, BATCH_SIZE, "Jittered Resize", (960, 960), "xyxy")
trainDataset = trainDataset.prefetch(tf.data.AUTOTUNE)
Visualize Dataset
# visualize single data
for data in dataset.take(1):
visualizeData(data, "xyxy")
# visualize dataset shown in 2x2 grid
visualizeDataset(dataset, "xyxy", rows=2, cols=2)
Metadata
Release files for tf-datachain 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tf_datachain-0.1.0.tar.gz | 4.5 kB | Without provenance | Details for tf_datachain-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tf_datachain-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for tf_datachain-0.1.0-py3-none-any.whl |
Total release size: 9.7 kB
Release files / tf_datachain-0.1.0.tar.gz
| Download URL | tf_datachain-0.1.0.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
18de6aaedfecc578677eb1ccdeb1984149382a3790841a2b7c7a31a5ff8f1ad6
|
|
BLAKE2b-256 checksum How to use checksums |
ba3bd774653b77d41b17101e463429ae40711b2acfc468db93eba32d16e9986c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.17
|
Release files / tf_datachain-0.1.0-py3-none-any.whl
| Download URL | tf_datachain-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
32f0accfd2328391056614359367192af876f37e00e90c4778d3f1283eed38bd
|
|
BLAKE2b-256 checksum How to use checksums |
e124c884bd9fcef437d73eeb82d85f2136edc3b9cc3d5fe26f76f4ab3ba0ef3c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.17
|
Security for tf-datachain 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.