y5gfunc.utils¶
utils
¶
Functions:
| Name | Description |
|---|---|
ranger |
Generates a sequence of numbers similar to range(), but allows floats. |
PickFrames |
Return a new clip with frames picked from input clip from the indices array. |
resolve_path |
Resolves a path to an absolute path and ensures necessary directories exist. |
ranger
¶
ranger(start: Union[int, float], end: Union[int, float], step: Union[int, float]) -> list[Union[int, float]]
Generates a sequence of numbers similar to range(), but allows floats.
Creates a list of numbers starting from start, incrementing by step, and stopping before end.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Union[int, float]
|
The starting value of the sequence (inclusive). |
required |
|
Union[int, float]
|
The end value of the sequence (exclusive). The sequence generated will contain values strictly
less than |
required |
|
Union[int, float]
|
The step/increment between consecutive numbers. Must not be zero. Can be negative for descending sequences. |
required |
Returns:
| Type | Description |
|---|---|
list[Union[int, float]]
|
A list of numbers (integers or floats) representing the generated sequence. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in y5gfunc/utils.py
PickFrames
¶
Return a new clip with frames picked from input clip from the indices array.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VideoNode
|
Input clip where frames are from. |
required |
|
list[int]
|
The indices array representing the frames to be picked. |
required |
Returns:
| Type | Description |
|---|---|
VideoNode
|
New clip with frames picked from input clip from the indices array. |
Source code in y5gfunc/utils.py
resolve_path
¶
Resolves a path to an absolute path and ensures necessary directories exist.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Union[Path, str]
|
The input path string or Path object to resolve and for which to ensure directory structure exists. |
required |
Returns:
| Type | Description |
|---|---|
Path
|
The absolute, resolved pathlib. Path object corresponding to the input path, after ensuring the relevant directory structure exists. |