List of nodes
Despite being Python classes, nodes follow a consistent logic are documented separately from the rest of the API. Below is a list of nodes included in the PixelPipes core.
Core nodes
- operation pixelpipes.graph.Constant(value)
Generates a constant in the pipeline
value [any]:
- operation pixelpipes.graph.Debug(source, prefix)
Debug operation enables low-level terminal output of the content that is provided to it. The token content will usually not be printed entierly, only its shape, the value will only be displayed for simple scalar types as well as strings.
Note that tese nodes will be passed to the pipeline only if the compiler is configered with debug flag, otherwise they will be stripped from the graph.
source [Token [None]]: Result of which node to print
prefix [str = ]: String that is prepended to the output
- operation pixelpipes.graph.Output(output, label)
Output node that accepts a single input, enables outputting tokens from the final pipeline. Tokens are returned as a tuple, their order is determined by the order of adding output nodes to the graph. Additionally you may also label outputs with non-unique lables that can be used to resolve outputs.
output [Token [None]]: Output token
label [str = default]: Nonunique label of the output
- operation pixelpipes.graph.RandomSeed
Returns a pseudo-random number, useful for initializing pseudo-random operations. The seed itself is sampled from a pseudo-random generator that produces the same sequence of seeds for a specific position in the data sequence. This is the corner-stone of repeatability of the pipeline.
- operation pixelpipes.graph.ReadFile(filename)
Read file from disk to memory buffer. File is read in binary mode.
filename [Token [char, None]]: Path to the image file
- operation pixelpipes.graph.SampleIndex
Returns current sample index. This information can be used instead of random seed to initialize random generators where sequential consistentcy is required.
- node pixelpipes.compiler.Variable(name, default)
Variable placeholder that can be overriden later
name [str]:
default []:
Scalar operations
- operation pixelpipes.numbers.Add(a, b)
a [Token [float]]: First operand
b [Token [float]]: Second operand
- operation pixelpipes.numbers.Ceil(source)
Ceil number and convert to integer.
source [Token [float]]: Number on which ceil operation is performed
- operation pixelpipes.numbers.Divide(a, b)
a [Token [float]]: First operand
b [Token [float]]: Second operand
- operation pixelpipes.numbers.Equal(a, b)
a [Token [float]]: First operand
b [Token [float]]: Second operand
- operation pixelpipes.numbers.Floor(source)
Floor number and convert to integer.
source [Token [float]]: Number to be rounded
- operation pixelpipes.numbers.Greater(a, b)
a [Token [float]]: First operand
b [Token [float]]: Second operand
- operation pixelpipes.numbers.GreaterEqual(a, b)
a [Token [float]]: First operand
b [Token [float]]: Second operand
- operation pixelpipes.numbers.Lower(a, b)
a [Token [float]]: First operand
b [Token [float]]: Second operand
- operation pixelpipes.numbers.LowerEqual(a, b)
a [Token [float]]: First operand
b [Token [float]]: Second operand
- operation pixelpipes.numbers.Maximum(a, b)
a [Token [float]]: First operand
b [Token [float]]: Second operand
- operation pixelpipes.numbers.Minimum(a, b)
a [Token [float]]: First operand
b [Token [float]]: Second operand
- operation pixelpipes.numbers.Modulo(a, b)
a [Token [int]]:
b [Token [int]]:
- operation pixelpipes.numbers.Multiply(a, b)
a [Token [float]]: First operand
b [Token [float]]: Second operand
- operation pixelpipes.numbers.NotEqual(a, b)
a [Token [float]]: First operand
b [Token [float]]: Second operand
- operation pixelpipes.numbers.Power(a, b)
a [Token [float]]: First operand
b [Token [float]]: Second operand
- macro pixelpipes.numbers.RandomBoolean(seed)
Samples a boolean value with equal probability
seed [Token [int] = @[random]]:
- operation pixelpipes.numbers.Round(source)
Round number to closest integer and convert to integer type.
source [Token [float]]: Number to be rounded
- operation pixelpipes.numbers.SampleNormal(mean, sigma, seed)
Samples values between from normal distribution.
mean [Token [float] = 0]: Mean value of normal distribution
sigma [Token [float] = 1]: Standard deviation
seed [Token [int] = @[random]]:
- operation pixelpipes.numbers.SampleUnform(min, max, seed)
Samples random value between min and max value.
min [Token [float]]: Minimun value
max [Token [float]]: Maximum value
seed [Token [int] = @[random]]:
- operation pixelpipes.numbers.Subtract(a, b)
a [Token [float]]: First operand
b [Token [float]]: Second operand
- operation pixelpipes.numbers.TensorAdd(a, b, saturate)
a [Token [None]]: First operand
b [Token [None]]: Second operand
saturate [bool = False]: Saturate cast
- operation pixelpipes.numbers.TensorDivide(a, b, saturate)
Divides image with another image or scalar (per-element multiplication).
a [Token [None]]: First operand
b [Token [None]]: Second operand
saturate [bool = False]: Saturate cast
- operation pixelpipes.numbers.TensorMultiply(a, b, saturate)
Multiplies image with another image or scalar (per-element multiplication).
a [Token [None]]: First operand
b [Token [None]]: Second operand
saturate [bool = False]: Saturate cast
- operation pixelpipes.numbers.TensorSubtract(a, b, saturate)
Subtracts two images with same size and number of channels or an image and a number.
a [Token [None]]: First operand
b [Token [None]]: Second operand
saturate [bool = False]: Saturate cast
- macro pixelpipes.expression.Expression(source, variables)
Numeric expression with variables
Macro that expands into an arithmetic expression parsed from an input string.
- Inputs:
source: text representation of arithmetic expression
variables: a map of inputs that are inserted into the expression
Category: arithmetic, macro
source [str]:
variables []:
Flow control
- operation pixelpipes.flow.Conditional(true, false, condition)
Node that executes conditional selection, output of branch “true” will be selected if the “condition” is not zero, otherwise output of branch “false” will be selected. Note that the inferred type of these two branches should match as much as possible, otherwise the inferred type of this node will cause problems with dependent nodes.
true [Token [None]]: Use this data if condition is true
false [Token [None]]: Use this data if condition is false
condition [Token [int]]: Condition to test
- macro pixelpipes.flow.Switch(inputs, weights, seed)
Random switch between multiple branches, a macro that generates a tree of binary choices based on a random variable. The probability of choosing a defined branch
inputs []: Two or more input branches
weights []: Corresponing branch weights
seed [Token [int] = @[random]]:
Lists
- operation pixelpipes.list.CompareEqual(a, b)
a [Token [float, None]]:
b [Token [float, None]]:
- operation pixelpipes.list.CompareGreater(a, b)
a [Token [float, None]]:
b [Token [float, None]]:
- operation pixelpipes.list.CompareGreaterEqual(a, b)
a [Token [float, None]]:
b [Token [float, None]]:
- operation pixelpipes.list.CompareLower(a, b)
a [Token [float, None]]:
b [Token [float, None]]:
- operation pixelpipes.list.CompareLowerEqual(a, b)
a [Token [float, None]]:
b [Token [float, None]]:
- operation pixelpipes.list.CompareNotEqual(a, b)
a [Token [float, None]]:
b [Token [float, None]]:
- operation pixelpipes.list.Concatenate(inputs)
inputs []: Two or more input lists
- operation pixelpipes.list.FileList(list)
String list of file patchs. Use this operation to inject file dependencies into the pipeline.
list []:
- operation pixelpipes.list.FilterSelect(parent, filter)
Generate a sublist based on values from a filter list
parent [Token [None]]:
filter [Token [int, None]]:
- operation pixelpipes.list.GetElement(parent, index)
Returns an element from a list for a given index
parent [Token [None]]:
index [Token [int]]:
- macro pixelpipes.list.GetRandom(source, seed)
source [Token [None]]:
seed [Token [int] = @[random]]:
- operation pixelpipes.list.Length(parent)
Returns a list length
parent [Token [None]]:
- operation pixelpipes.list.ListAsTable(parent, row)
Transform list to table
parent [Token [None, None]]: Source list
row [Token [int]]: Row size, total length of list must be its multiple
- operation pixelpipes.list.LogicalAnd(a, b)
a [Token [bool, None]]:
b [Token [bool, None]]:
- operation pixelpipes.list.LogicalNot(a)
a [Token [bool, None]]:
- operation pixelpipes.list.LogicalOr(a, b)
a [Token [bool, None]]:
b [Token [bool, None]]:
- operation pixelpipes.list.MakeList(inputs)
Builds list from inputs. All inputs should be of the same type as the first input, it determines the type of a list.
inputs []:
- operation pixelpipes.list.Modulo(a, b)
a [Token [int, None]]:
b [Token [int, None]]:
- operation pixelpipes.list.Permutation(length, seed)
Generates a list of numbers from 0 to length in random order.
length [Token [int]]:
seed [Token [int] = @[random]]:
- operation pixelpipes.list.Permute(source, seed)
Randomly permutes an input list
source [Token [None]]: Input list
seed [Token [int] = @[random]]:
- operation pixelpipes.list.Range(start, end, length, round)
Generates a list of numbers from start to end of a given length
start [Token [float]]:
end [Token [float]]:
length [Token [int]]:
round [Token [bool] = False]:
- operation pixelpipes.list.Remap(source, indices)
Maps elements from source list to a result list using indices from indices list.
source [Token [None]]:
indices [Token [int, None]]:
- operation pixelpipes.list.Repeat(source, length)
Repeat list element a number of times
source [Token [None]]: Element to repeat
length [Token [int]]: Number of repetitions
- operation pixelpipes.list.SublistSelect(parent, begin, end)
Selects a range from the source list as a new list.
parent [Token [None]]: Source list
begin [Token [int]]: Start index
end [Token [int]]: End index
- macro pixelpipes.list.Table(source)
Constant Table
- Inputs:
source: Table type
Category: list
source []:
Geometery
Images
Resources
- macro pixelpipes.resource.AppendField(source, name, value)
Produce a resource from an input resource and another field. Essentially just node renaming.
source [Resource ()]: Original resource
name [str]: Name of new field
value [Token [None]]: Value for new field
- macro pixelpipes.resource.ConditionalResource(true, false, condition)
Node that executes conditional selection, output of branch “true” will be selected if the “condition” is not zero, otherwise output of branch “false” will be selected.
true [Resource ()]: Use this data if condition is true
false [Resource ()]: Use this data if condition is false
condition [Token [int]]: Condition to test
- macro pixelpipes.resource.GetField(source, element)
This macro exposes only selected field of an input structure as an output, enabling processing of that data.
source [Resource ()]: Input resource
element [str]: Name of the structure field
- macro pixelpipes.resource.MakeResource(inputs)
Macro that generates a resource from given inputs
inputs [ = {}]: A map of inputs that are inserted into the expression
- macro pixelpipes.resource.list.GetLastResource(resources)
resources [Resource (__list_length)]:
- macro pixelpipes.resource.list.GetResource(resources, index)
resources [Resource (__list_length)]:
index [Token [int]]:
- macro pixelpipes.resource.list.GetResourceListLength(resources)
resources [Resource (__list_length)]:
- macro pixelpipes.resource.list.ListInterval(resources, begin, end)
resources [Resource (__list_length)]:
begin [Token [int]]:
end [Token [int]]:
- macro pixelpipes.resource.list.PermuteResourceSegments(resources, seed)
resources [Resource (__list_length, __list_seg_begin, __list_seg_end)]:
seed [Token [int] = @[random]]:
- macro pixelpipes.resource.list.PermuteResources(resources)
Randomly permutes the resource list
resources [Resource (__list_length)]:
- macro pixelpipes.resource.list.RandomResource(resources, seed)
Select a random resource from an input list of resources
resources [Resource (__list_length)]:
seed [Token [int] = @[random]]:
- macro pixelpipes.resource.list.RandomResourceSegment(resources, seed)
resources [Resource (__list_length, __list_seg_begin, __list_seg_end)]:
seed [Token [int] = @[random]]:
- macro pixelpipes.resource.list.RepeatResource(resource, length)
Returns a list of resources where an input resource is repeated a number of times
resource [Resource ()]: Resource to repeat
length [Token [int]]: Number of repetitions
- macro pixelpipes.resource.list.ResourceSegment(resources, index)
resources [Resource (__list_length, __list_seg_begin, __list_seg_end)]:
index [Token [int]]:
- macro pixelpipes.resource.list.SegmentCount(resources)
resources [Resource (__list_length, __list_seg_begin, __list_seg_end)]: