webp Driver¶
The webp driver specifies a TensorStore backed by a webp image file.
The read volume is indexed by “height” (y), “width” (x), “channel”.
The webp driver supports either 3 (RGB) or 4 (RGBA) channel WebP images.
Lossy WebP images are encoded as YUV 422, incurring some perceptual loss.
- json driver/webp : object¶
- Extends:¶
TensorStoreKvStoreAdapter— Specifies a TensorStore stored using a base key-value store.
- Required members:¶
-
driver :
"webp"¶
- kvstore : KvStore | KvStoreUrl¶
Base key-value store for the TensorStore.
-
driver :
- Optional members:¶
-
-
dtype :
"uint8"¶ Optional. If specified, must be
"uint8".
-
rank : integer[
0,32]¶ Specifies the rank of the TensorStore.
If
transformis also specified, the input rank must match. Otherwise, the rank constraint applies to the driver directly.
- transform : IndexTransform¶
Specifies a transform.
- schema : Schema¶
Specifies constraints on the schema.
When opening an existing array, specifies constraints on the existing schema; opening will fail if the constraints do not match. Any soft constraints specified in the
chunk_layoutare ignored. When creating a new array, a suitable schema will be selected automatically based on the specified schema constraints in combination with any driver-specific constraints.
-
path : string =
""¶ Additional path relative to
kvstore.This is joined as an additional
"/"-separated path component after anypathmember directly withinkvstore. This is supported for backwards compatibility only; theKvStore.pathmember should be used instead.Example
"path/to/data"
-
cache_pool : ContextResource =
"cache_pool"¶ Cache pool for data.
Specifies or references a previously defined
Context.cache_pool. It is normally more convenient to specify a defaultcache_poolin thecontext.
-
data_copy_concurrency : ContextResource =
"data_copy_concurrency"¶ Specifies or references a previously defined
Context.data_copy_concurrency. It is normally more convenient to specify a defaultdata_copy_concurrencyin thecontext.
-
recheck_cached_data : CacheRevalidationBound =
"open"¶ Time after which cached data is assumed to be fresh.
Cached data older than the specified time is revalidated prior to being returned from a read operation. Writes are always consistent regardless of the value of this option.
Specifying
truemeans that the data will be revalidated prior to every read operation. With a value of"open", any cached data is revalidated when the TensorStore is opened but is not rechecked for each read operation.Note
To enable in-memory data caching, you must both specify a
cache_poolwith a non-zerototal_bytes_limitand also specifyfalse,"open", or an explicit time bound forrecheck_cached_data.
-
lossless : boolean =
"true"¶ Unused. AVIF lossless encoding setting.
-
quality : number =
"95"¶ Unused. WebP quality between 0 and 100. Higher values are better quality.
-
dtype :
Example
{"driver": "webp", "kvstore": "gs://my-bucket/path-to-image.webp"}
- json TensorStoreUrl/webp : string¶
webp:TensorStore URL schemeWebP TensorStores may be specified using the
webp:URL syntax.Examples
URL representation
JSON representation
"gs://my-bucket/path-to-image.webp/|webp:"{"driver": "webp", "kvstore": {"driver": "gcs", "bucket": "my-bucket", "path": "path-to-image.webp"} }- Extends:¶
TensorStoreUrl— URL representation of a TensorStore to open.
Auto detection¶
This driver supports auto-detection based on the signature at the start of the file.