evlib.dataloaders.utils¶
Shared helpers for dataloader indexing, caching, and optional decoding.
Functions
|
Decode files with a bounded thread pool. |
|
Return the index of the timestamp nearest to |
|
Make an array read only if it exists. |
|
Return cached base coordinate grids for dense flow propagation. |
|
Normalize one Python style sequence index and validate bounds. |
|
Normalize many Python style sequence indices and validate bounds. |
|
Propagate pixel coordinates through one GT flow field in place. |
|
Sample dense flow at floating coordinates with nearest-neighbor. |
|
Sample dense flow at floating coordinates with NumPy nearest neighbor. |
|
Validate a half open |
Classes
|
Small process local LRU cache for decoded file payloads. |
- evlib.dataloaders.utils.freeze_array(arr)¶
Make an array read only if it exists.
- class evlib.dataloaders.utils.LazyDecodeCache(max_items)¶
Small process local LRU cache for decoded file payloads.
- Parameters:
max_items (int)
- get(index)¶
Return a cached decoded value by index, or None on a miss.
- Parameters:
index (int)
- Return type:
_DecodedValueT | None
- put(index, decoded_value)¶
Store and return a decoded value.
- Parameters:
index (int)
decoded_value (_DecodedValueT)
- Return type:
_DecodedValueT
- clear()¶
Remove all cached values.
- Return type:
None
- evlib.dataloaders.utils.decode_in_parallel(paths, decoder, *, max_workers)¶
Decode files with a bounded thread pool.
- evlib.dataloaders.utils.normalize_index(index, sequence_length, item_name)¶
Normalize one Python style sequence index and validate bounds.
- evlib.dataloaders.utils.normalize_indices(indices, sequence_length, item_name)¶
Normalize many Python style sequence indices and validate bounds.
- evlib.dataloaders.utils.validate_index_interval(start_index, end_index, sequence_length, item_name)¶
Validate a half open
[start_index, end_index)interval.
- evlib.dataloaders.utils.find_nearest_index(timestamps, t)¶
Return the index of the timestamp nearest to
t.
- evlib.dataloaders.utils.get_flow_coordinate_grid(height, width)¶
Return cached base coordinate grids for dense flow propagation.
- evlib.dataloaders.utils.sample_flow_nearest_numpy(x_flow, y_flow, x_coords, y_coords)¶
Sample dense flow at floating coordinates with NumPy nearest neighbor.
- evlib.dataloaders.utils.sample_flow_nearest(x_flow, y_flow, x_coords, y_coords)¶
Sample dense flow at floating coordinates with nearest-neighbor.
- evlib.dataloaders.utils.propagate_flow_step(x_flow, y_flow, x_coords, y_coords, x_mask, y_mask, scale)¶
Propagate pixel coordinates through one GT flow field in place.