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
- class pixelpipes.graph.Constant(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Generates a constant in the pipeline
- key()
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- static resolve_type(value)
- value
- pixelpipes.graph.ContextFields
- class pixelpipes.graph.Copy(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Copy node is a special node that copies the input to the output. It is not an operation or a macro, it is only used as a helper and is removed during compilation.
- source
- class pixelpipes.graph.Data
Abstract type base, represents description of token types accepted or returned by nodes.
- class pixelpipes.graph.Debug(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
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.
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- prefix
- source
- class pixelpipes.graph.EnumerationInput(options, default=None, description='')
- coerce(value, _)
- dump(value)
- class pixelpipes.graph.Graph(prefix: str | Reference | None = '')
-
- commit()
- copy()
- static default()
- static has_default()
- nodes()
- pipeline(variables=None, output=None)
- class pixelpipes.graph.InferredReference(ref: str, data)
A node reference with type or value already inferred. Used during compilation and in macro expansion.
- property type
- class pixelpipes.graph.Input(reftype: pixelpipes.types.Data, default: str | float | int | None = None, description: str | None = '')
- coerce(value, _)
- dump(value)
- reftype()
- class pixelpipes.graph.Macro(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class for all nodes in a computation graph.
- property context
- evaluate(**inputs)
Will not evaluate to a type, just return None
- abstract expand(**inputs)
- class pixelpipes.graph.Node(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class for all nodes in a computation graph.
- duplicate(_name=None, _origin=None, **inputs)
- evaluate(**inputs)
- property frame
- get_inputs()
- input_names()
- input_types()
- input_values()
- classmethod name()
- property origin
Only relevant for nodes generated during compilation, makes it easier to track original node from the source graph. Returns None in other cases.
- exception pixelpipes.graph.NodeException(*args, node: Node | None = None)
Common base class for all non-exit exceptions.
- property node
- nodestack()
- print_nodestack()
- class pixelpipes.graph.NodeOperation(*args, **kwds)
Create a collection of name/value pairs.
Example enumeration:
>>> class Color(Enum): ... RED = 1 ... BLUE = 2 ... GREEN = 3
Access them by:
attribute access:
>>> Color.RED <Color.RED: 1>
value lookup:
>>> Color(1) <Color.RED: 1>
name lookup:
>>> Color['RED'] <Color.RED: 1>
Enumerations can be iterated over, and know how many members they have:
>>> len(Color) 3
>>> list(Color) [<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]
Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.
- ADD
- DIVIDE
- EQUAL
- GREATER
- GREATER_EQUAL
- INDEX
- LENGTH
- LOGICAL_AND
- LOGICAL_NOT
- LOGICAL_OR
- LOWER
- LOWER_EQUAL
- MODULO
- MULIPLY
- NEGATE
- NOT_EQUAL
- POWER
- SUBTRACT
- class pixelpipes.graph.Operation(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class of all atomic nodes that generate pipeline operations
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.graph.OperationProxy
- static query_operation(operation: NodeOperation, *qargs: pixelpipes.types.Data)
- static register_operation(operation: NodeOperation, generator: Callable, *args: pixelpipes.types.Data)
- class pixelpipes.graph.Output(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
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.
- label
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- output
- class pixelpipes.graph.RandomSeed(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
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()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.graph.ReadFile(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Read file from disk to memory buffer. File is read in binary mode.
- filename
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.graph.SampleIndex(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Returns current sample index. This information can be used instead of random seed to initialize random generators where sequential consistentcy is required.
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.graph.SeedInput(description='')
- exception pixelpipes.graph.ValidationException(*args, node: Node | None = None)
Common base class for all non-exit exceptions.
- pixelpipes.graph.evaluate_operation(name: str, inputs, arguments)
- pixelpipes.graph.outputs(*inputs, label='default')
- pixelpipes.graph.wrap_pybind_enum(bindenum)
- class pixelpipes.compiler.Compiler(debug=False)
Compiler object contains utilities to validate a graph and compiles it to a pipeline (a sequence of operations, written in native code) that can be executed to obtain output variables.
- build(graph: pixelpipes.graph.Graph, variables: Mapping[str, numbers.Number] | None = None, output: collections.abc.Container | Callable | None = None, optimize: bool = None)
Compiles the graph and builds a pipeline from it in one function.
- Args:
graph (Graph): _description_ variables (typing.Optional[typing.Mapping[str, numbers.Number]], optional): _description_. Defaults to None. output (typing.Optional[typing.Union[Container, typing.Callable]], optional): _description_. Defaults to None. optimize (bool, optional): Optimize conditional operations by inserting jumps into the pipeline and using cache.
- Returns:
Pipeline: Pipeline object
- static build_graph(graph: pixelpipes.graph.Graph | Mapping[str, pixelpipes.graph.Node], variables: Mapping[str, numbers.Number] | None = None, output: str | None = None)
- compile(graph: pixelpipes.graph.Graph, variables: Mapping[str, numbers.Number] | None = None, output: collections.abc.Container | Callable | None = None)
Compile a graph into a pipeline of native operations.
- Args:
graph (Graph): Graph representation
- Raises:
CompilerException: raised if graph is not valid
- Returns:
engine.Pipeline: resulting pipeline
- validate(graph: pixelpipes.graph.Graph | Mapping[str, pixelpipes.graph.Node])
Validates graph by interring input and output types for all nodes. An exception will be thrown if dependencies cannot be resolved or if output of a node is not compatible with an input specification of a dependant node.
- Args:
graph (typing.Mapping or Graph): Graph representation
- Raises:
ValidationException: Different validation errors share this exception type
- Returns:
dict: resolved types of all nodes
- exception pixelpipes.compiler.CompilerException
Common base class for all non-exit exceptions.
- class pixelpipes.compiler.Conditional(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
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.
- condition
- false
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- true
- class pixelpipes.compiler.Constant(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Generates a constant in the pipeline
- key()
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- static resolve_type(value)
- value
- class pixelpipes.compiler.Copy(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Copy node is a special node that copies the input to the output. It is not an operation or a macro, it is only used as a helper and is removed during compilation.
- source
- class pixelpipes.compiler.Debug(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
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.
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- prefix
- source
- class pixelpipes.compiler.Graph(prefix: str | Reference | None = '')
-
- commit()
- copy()
- static default()
- static has_default()
- nodes()
- pipeline(variables=None, output=None)
- class pixelpipes.compiler.InferredReference(ref: str, data)
A node reference with type or value already inferred. Used during compilation and in macro expansion.
- property type
- class pixelpipes.compiler.Macro(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class for all nodes in a computation graph.
- property context
- evaluate(**inputs)
Will not evaluate to a type, just return None
- abstract expand(**inputs)
- class pixelpipes.compiler.Node(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class for all nodes in a computation graph.
- duplicate(_name=None, _origin=None, **inputs)
- evaluate(**inputs)
- property frame
- get_inputs()
- input_names()
- input_types()
- input_values()
- classmethod name()
- property origin
Only relevant for nodes generated during compilation, makes it easier to track original node from the source graph. Returns None in other cases.
- exception pixelpipes.compiler.NodeException(*args, node: Node | None = None)
Common base class for all non-exit exceptions.
- property node
- nodestack()
- print_nodestack()
- class pixelpipes.compiler.Operation(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class of all atomic nodes that generate pipeline operations
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.compiler.Output(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
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.
- label
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- output
- class pixelpipes.compiler.Pipeline(data: Iterable[PipelineOperation], optimize: bool = None)
Wrapper for the C++ pipeline object, includes additional metadata. This wrapper should be used instead of interacting with the C++ object directly.
- property metadata
Accesses the pipeline metadata storage.
- Returns:
MappingProxyType: A string to string key-value storage.
- property outputs
Returns description of the pipeline outputs.
- Returns:
List[Tuple[str, “pixelpipes.types.Token”]]: List of tuples with output name and inferred type.
- run(index: int)
Executes the pipeline for a given index and resturns result
- Args:
index (int): Index of sample to generate. Starts with 1.
- Returns:
Tuple[np.ndarray]: Generated sample, a sequence of NumPy objects.
- pixelpipes.compiler.PipelineOperation
- class pixelpipes.compiler.RandomSeed(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
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()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.compiler.SampleIndex(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Returns current sample index. This information can be used instead of random seed to initialize random generators where sequential consistentcy is required.
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- exception pixelpipes.compiler.ValidationException(*args, node: Node | None = None)
Common base class for all non-exit exceptions.
- pixelpipes.compiler.infer_type(node: pixelpipes.graph.Reference | str, graph: pixelpipes.graph.Graph = None, type_cache: Mapping[str, pixelpipes.types.Data] = None)
Computes output type for a given node by recursively computing types of its dependencies and calling validate method of a node with the information about their computed output types.
- Args:
node (typing.Union[Reference, typing.Type[Node]]): Reference of the node or raw value graph (Graph): Mapping of all nodes in the graph type_cache (typing.Mapping[str, types.Type], optional): Optional cache for already computed types. Makes repetititve calls much faster. Defaults to None.
- Raises:
ValidationException: Contains information about the error during node validation process.
- Returns:
types.Type: Computed type for the given node.
- pixelpipes.compiler.toposort(data)
Dependencies are expressed as a dictionary whose keys are items and whose values are a set of dependent items. Output is a list of sets in topological order. The first set consists of items with no dependences, each subsequent set consists of items that depend upon items in the preceeding sets.
Scalar operations
- class pixelpipes.numbers.Add(*args, **kwargs)
Base class of all atomic nodes that generate pipeline operations
- a
- b
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- saturate
- class pixelpipes.numbers.ArcCos(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class of all atomic nodes that generate pipeline operations
- a
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.numbers.ArcSin(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class of all atomic nodes that generate pipeline operations
- a
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.numbers.ArcTan(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class of all atomic nodes that generate pipeline operations
- a
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.numbers.ArcTan2(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class of all atomic nodes that generate pipeline operations
- a
- b
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.numbers.Ceil(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Ceil number to closest integer.
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- source
- class pixelpipes.numbers.Constant(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Generates a constant in the pipeline
- key()
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- static resolve_type(value)
- value
- class pixelpipes.numbers.Cos(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class of all atomic nodes that generate pipeline operations
- a
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- pixelpipes.numbers.DataType
- class pixelpipes.numbers.Divide(*args, **kwargs)
Base class of all atomic nodes that generate pipeline operations
- a
- b
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- saturate
- class pixelpipes.numbers.EnumerationInput(options, default=None, description='')
- coerce(value, _)
- dump(value)
- class pixelpipes.numbers.Equal(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class of all atomic nodes that generate pipeline operations
- a
- b
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.numbers.Floor(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Floor number to closest integer.
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- source
- class pixelpipes.numbers.Greater(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class of all atomic nodes that generate pipeline operations
- a
- b
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.numbers.GreaterEqual(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class of all atomic nodes that generate pipeline operations
- a
- b
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.numbers.Input(reftype: pixelpipes.types.Data, default: str | float | int | None = None, description: str | None = '')
- coerce(value, _)
- dump(value)
- reftype()
- class pixelpipes.numbers.LogicalAnd(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class of all atomic nodes that generate pipeline operations
- a
- b
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.numbers.LogicalNot(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class of all atomic nodes that generate pipeline operations
- a
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.numbers.LogicalOr(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class of all atomic nodes that generate pipeline operations
- a
- b
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.numbers.Lower(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class of all atomic nodes that generate pipeline operations
- a
- b
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.numbers.LowerEqual(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class of all atomic nodes that generate pipeline operations
- a
- b
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.numbers.Macro(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class for all nodes in a computation graph.
- property context
- evaluate(**inputs)
Will not evaluate to a type, just return None
- abstract expand(**inputs)
- class pixelpipes.numbers.Max(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Piecewise maximum of two values.
- a
- b
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.numbers.Maximum(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class of all atomic nodes that generate pipeline operations
- a
- b
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.numbers.Min(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Piecewise minimum of two values.
- a
- b
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.numbers.Minimum(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class of all atomic nodes that generate pipeline operations
- a
- b
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.numbers.Modulo(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class of all atomic nodes that generate pipeline operations
- a
- b
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.numbers.Multiply(*args, **kwargs)
Base class of all atomic nodes that generate pipeline operations
- a
- b
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- saturate
- class pixelpipes.numbers.Node(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class for all nodes in a computation graph.
- duplicate(_name=None, _origin=None, **inputs)
- evaluate(**inputs)
- property frame
- get_inputs()
- input_names()
- input_types()
- input_values()
- classmethod name()
- property origin
Only relevant for nodes generated during compilation, makes it easier to track original node from the source graph. Returns None in other cases.
- exception pixelpipes.numbers.NodeException(*args, node: Node | None = None)
Common base class for all non-exit exceptions.
- property node
- nodestack()
- print_nodestack()
- class pixelpipes.numbers.NodeOperation(*args, **kwds)
Create a collection of name/value pairs.
Example enumeration:
>>> class Color(Enum): ... RED = 1 ... BLUE = 2 ... GREEN = 3
Access them by:
attribute access:
>>> Color.RED <Color.RED: 1>
value lookup:
>>> Color(1) <Color.RED: 1>
name lookup:
>>> Color['RED'] <Color.RED: 1>
Enumerations can be iterated over, and know how many members they have:
>>> len(Color) 3
>>> list(Color) [<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]
Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.
- ADD
- DIVIDE
- EQUAL
- GREATER
- GREATER_EQUAL
- INDEX
- LENGTH
- LOGICAL_AND
- LOGICAL_NOT
- LOGICAL_OR
- LOWER
- LOWER_EQUAL
- MODULO
- MULIPLY
- NEGATE
- NOT_EQUAL
- POWER
- SUBTRACT
- class pixelpipes.numbers.NotEqual(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class of all atomic nodes that generate pipeline operations
- a
- b
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.numbers.Operation(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class of all atomic nodes that generate pipeline operations
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.numbers.Power(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class of all atomic nodes that generate pipeline operations
- a
- b
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.numbers.RandomBoolean(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Samples a boolean value with equal probability
- expand(seed)
- seed
- class pixelpipes.numbers.Round(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Round number to closest integer.
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- source
- class pixelpipes.numbers.SampleBernoulli(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class of all atomic nodes that generate pipeline operations
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- p
- seed
- class pixelpipes.numbers.SampleBinomial(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class of all atomic nodes that generate pipeline operations
- n
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- p
- seed
- class pixelpipes.numbers.SampleNormal(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Samples values between from normal distribution.
- mean
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- seed
- sigma
- class pixelpipes.numbers.SampleUnform(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Samples random value between min and max value.
- max
- min
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- seed
- class pixelpipes.numbers.Saturate
Context for saturated cast operations.
- class pixelpipes.numbers.SaturateOperation(*args, **kwargs)
Base class of all atomic nodes that generate pipeline operations
- class pixelpipes.numbers.SeedInput(description='')
- class pixelpipes.numbers.Sin(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class of all atomic nodes that generate pipeline operations
- a
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.numbers.SquareRoot(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class of all atomic nodes that generate pipeline operations
- a
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.numbers.Subtract(*args, **kwargs)
Base class of all atomic nodes that generate pipeline operations
- a
- b
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- saturate
- class pixelpipes.numbers.Tan(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class of all atomic nodes that generate pipeline operations
- a
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.expression.Copy(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Copy node is a special node that copies the input to the output. It is not an operation or a macro, it is only used as a helper and is removed during compilation.
- source
- class pixelpipes.expression.Expression(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
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
- duplicate(_origin=None, **inputs)
- expand(**inputs)
- get_inputs()
- input_values()
- source
- variables
- class pixelpipes.expression.Graph(prefix: str | Reference | None = '')
-
- commit()
- copy()
- static default()
- static has_default()
- nodes()
- pipeline(variables=None, output=None)
- class pixelpipes.expression.Input(reftype: pixelpipes.types.Data, default: str | float | int | None = None, description: str | None = '')
- coerce(value, _)
- dump(value)
- reftype()
- class pixelpipes.expression.Macro(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class for all nodes in a computation graph.
- property context
- evaluate(**inputs)
Will not evaluate to a type, just return None
- abstract expand(**inputs)
- class pixelpipes.expression.TestBase(methodName='runTest')
A class whose instances are single test cases.
By default, the test code itself should be placed in a method named ‘runTest’.
If the fixture may be used for many test cases, create as many test methods as are needed. When instantiating such a TestCase subclass, specify in the constructor arguments the name of the test method that the instance is to execute.
Test authors should subclass TestCase for their own tests. Construction and deconstruction of the test’s environment (‘fixture’) can be implemented by overriding the ‘setUp’ and ‘tearDown’ methods respectively.
If it is necessary to override the __init__ method, the base class __init__ method must always be called. It is important that subclasses should not change the signature of their __init__ method, since instances of the classes are instantiated automatically by parts of the framework in order to be run.
When subclassing TestCase, you can set these attributes: * failureException: determines which exception will be raised when
the instance’s assertion methods fail; test methods raising this exception will be deemed to have ‘failed’ rather than ‘errored’.
- longMessage: determines whether long messages (including repr of
objects used in assert methods) will be printed on failure in addition to any explicit message passed.
- maxDiff: sets the maximum length of a diff in failure messages
by assert methods using difflib. It is looked up as an instance attribute so can be configured by individual tests if required.
- compare_arrays(a, b)
Compares two arrays ignoring singleton dimensions at the beginning or end
- setUp()
Hook method for setting up the test fixture before exercising it.
- tearDown()
Hook method for deconstructing the test fixture after testing it.
- class pixelpipes.expression.Tests(methodName='runTest')
A class whose instances are single test cases.
By default, the test code itself should be placed in a method named ‘runTest’.
If the fixture may be used for many test cases, create as many test methods as are needed. When instantiating such a TestCase subclass, specify in the constructor arguments the name of the test method that the instance is to execute.
Test authors should subclass TestCase for their own tests. Construction and deconstruction of the test’s environment (‘fixture’) can be implemented by overriding the ‘setUp’ and ‘tearDown’ methods respectively.
If it is necessary to override the __init__ method, the base class __init__ method must always be called. It is important that subclasses should not change the signature of their __init__ method, since instances of the classes are instantiated automatically by parts of the framework in order to be run.
When subclassing TestCase, you can set these attributes: * failureException: determines which exception will be raised when
the instance’s assertion methods fail; test methods raising this exception will be deemed to have ‘failed’ rather than ‘errored’.
- longMessage: determines whether long messages (including repr of
objects used in assert methods) will be printed on failure in addition to any explicit message passed.
- maxDiff: sets the maximum length of a diff in failure messages
by assert methods using difflib. It is looked up as an instance attribute so can be configured by individual tests if required.
- test_expression()
Flow control
- class pixelpipes.flow.Conditional(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
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.
- condition
- false
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- true
- class pixelpipes.flow.Copy(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Copy node is a special node that copies the input to the output. It is not an operation or a macro, it is only used as a helper and is removed during compilation.
- source
- class pixelpipes.flow.Input(reftype: pixelpipes.types.Data, default: str | float | int | None = None, description: str | None = '')
- coerce(value, _)
- dump(value)
- reftype()
- class pixelpipes.flow.Macro(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class for all nodes in a computation graph.
- property context
- evaluate(**inputs)
Will not evaluate to a type, just return None
- abstract expand(**inputs)
- exception pixelpipes.flow.NodeException(*args, node: Node | None = None)
Common base class for all non-exit exceptions.
- property node
- nodestack()
- print_nodestack()
- class pixelpipes.flow.Operation(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class of all atomic nodes that generate pipeline operations
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.flow.SeedInput(description='')
- class pixelpipes.flow.Switch(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
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
- expand(**inputs)
Decomposes switch statement into a series of internal conditional nodes that are recognized by the graph compiler. Adds a uniform distribition sampler as a source of the switch.
- get_inputs()
- input_values()
- inputs
- seed
- weights
Lists
- class pixelpipes.list.Concatenate(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class of all atomic nodes that generate pipeline operations
- duplicate(_origin=None, **inputs)
- get_inputs()
- input_values()
- inputs
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.list.Constant(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Generates a constant in the pipeline
- key()
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- static resolve_type(value)
- value
- class pixelpipes.list.Convert(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Converts input to different primitive data type.
- dtype
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- source
- class pixelpipes.list.FileList(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
String list of file patchs. Use this operation to inject file dependencies into the pipeline.
- list
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.list.Filter(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Generate a sublist based on values from a filter list
- filter
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- parent
- class pixelpipes.list.GetElement(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Returns an element from a list for a given index
- index
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- parent
- class pixelpipes.list.GetRandom(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class for all nodes in a computation graph.
- expand(source, seed)
- seed
- source
- class pixelpipes.list.Input(reftype: pixelpipes.types.Data, default: str | float | int | None = None, description: str | None = '')
- coerce(value, _)
- dump(value)
- reftype()
- class pixelpipes.list.Length(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Returns a list length
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- parent
- class pixelpipes.list.ListAsTable(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Transform list to table
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- parent
- row
- class pixelpipes.list.Macro(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class for all nodes in a computation graph.
- property context
- evaluate(**inputs)
Will not evaluate to a type, just return None
- abstract expand(**inputs)
- class pixelpipes.list.MakeList(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Builds list from inputs. All inputs should be of the same type as the first input, it determines the type of a list.
- duplicate(_origin=None, **inputs)
- get_inputs()
- input_values()
- inputs
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.list.Node(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class for all nodes in a computation graph.
- duplicate(_name=None, _origin=None, **inputs)
- evaluate(**inputs)
- property frame
- get_inputs()
- input_names()
- input_types()
- input_values()
- classmethod name()
- property origin
Only relevant for nodes generated during compilation, makes it easier to track original node from the source graph. Returns None in other cases.
- class pixelpipes.list.NodeOperation(*args, **kwds)
Create a collection of name/value pairs.
Example enumeration:
>>> class Color(Enum): ... RED = 1 ... BLUE = 2 ... GREEN = 3
Access them by:
attribute access:
>>> Color.RED <Color.RED: 1>
value lookup:
>>> Color(1) <Color.RED: 1>
name lookup:
>>> Color['RED'] <Color.RED: 1>
Enumerations can be iterated over, and know how many members they have:
>>> len(Color) 3
>>> list(Color) [<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]
Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.
- ADD
- DIVIDE
- EQUAL
- GREATER
- GREATER_EQUAL
- INDEX
- LENGTH
- LOGICAL_AND
- LOGICAL_NOT
- LOGICAL_OR
- LOWER
- LOWER_EQUAL
- MODULO
- MULIPLY
- NEGATE
- NOT_EQUAL
- POWER
- SUBTRACT
- class pixelpipes.list.Operation(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class of all atomic nodes that generate pipeline operations
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.list.Permutation(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Generates a list of numbers from 0 to length in random order.
- length
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- seed
- class pixelpipes.list.Permute(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Randomly permutes an input list
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- seed
- source
- class pixelpipes.list.Range(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Generates a list of numbers from start to end of a given length
- end
- length
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- round
- start
- class pixelpipes.list.Remap(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Maps elements from source list to a result list using indices from indices list.
- indices
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- source
- class pixelpipes.list.Repeat(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Repeat list element a number of times
- length
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- source
- class pixelpipes.list.Round(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Round number to closest integer.
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- source
- class pixelpipes.list.SampleUnform(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Samples random value between min and max value.
- max
- min
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- seed
- class pixelpipes.list.SeedInput(description='')
- class pixelpipes.list.Sublist(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Selects a range from the source list as a new list.
- begin
- end
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- parent
- class pixelpipes.list.Table(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Constant Table
- Inputs:
source: Table type
Category: list
- expand()
- source
- pixelpipes.list.Wildlist(element=None)
Geometery
- pixelpipes.geometry.load_module(name)
- class pixelpipes.geometry.points.Input(reftype: pixelpipes.types.Data, default: str | float | int | None = None, description: str | None = '')
- coerce(value, _)
- dump(value)
- reftype()
- class pixelpipes.geometry.points.Macro(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class for all nodes in a computation graph.
- property context
- evaluate(**inputs)
Will not evaluate to a type, just return None
- abstract expand(**inputs)
- class pixelpipes.geometry.points.MakeList(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Builds list from inputs. All inputs should be of the same type as the first input, it determines the type of a list.
- duplicate(_origin=None, **inputs)
- get_inputs()
- input_values()
- inputs
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.geometry.points.MakePoint(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Creates a point from two numerical inputs
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- x
- y
- class pixelpipes.geometry.points.MakePoints(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Creates a list of points from an even number of numerical inputs
- duplicate(_origin=None, **inputs)
- get_inputs()
- input_values()
- inputs
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.geometry.points.MakeRectangle(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Creates a bounding box from four values.
- bottom
- expand(left, top, right, bottom)
- left
- right
- top
- class pixelpipes.geometry.points.Operation(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class of all atomic nodes that generate pipeline operations
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- pixelpipes.geometry.points.Point()
- pixelpipes.geometry.points.PointBroadcastType
- pixelpipes.geometry.points.Points(length=None)
- class pixelpipes.geometry.points.PointsBounds(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Computes an axis aligned bounging box on a set of points
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- points
- pixelpipes.geometry.points.PointsBroadcastType
- class pixelpipes.geometry.points.PointsCenter(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Computes center of point set as an average of all coordinates
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- source
- class pixelpipes.geometry.points.PointsFromRectangle(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Convert bounding box to a list of points
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- source
- class pixelpipes.geometry.points.RandomPoints(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Generates a list of random points
- count
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- seed
- pixelpipes.geometry.points.Rectangle()
- class pixelpipes.geometry.points.SeedInput(description='')
- pixelpipes.geometry.points.View()
- class pixelpipes.geometry.view.AffineView(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Create an affine transformation view.
- angle
- expand(x, y, angle, sx, sy)
- sx
- sy
- x
- y
- class pixelpipes.geometry.view.CenterView(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Create a view that centers to a bounding box.
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- source
- class pixelpipes.geometry.view.Chain(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Multiply a series of views
- get_inputs()
- input_values()
- inputs
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.geometry.view.FocusView(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Create a view that centers to a bounding box and scales so that bounding box maintains relative scale.
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- scale
- source
- class pixelpipes.geometry.view.IdentityView(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Create a 2D identity matrix.
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.geometry.view.Input(reftype: pixelpipes.types.Data, default: str | float | int | None = None, description: str | None = '')
- coerce(value, _)
- dump(value)
- reftype()
- class pixelpipes.geometry.view.Macro(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class for all nodes in a computation graph.
- property context
- evaluate(**inputs)
Will not evaluate to a type, just return None
- abstract expand(**inputs)
- class pixelpipes.geometry.view.Operation(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class of all atomic nodes that generate pipeline operations
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.geometry.view.RotateView(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Create a 2D rotation matrix.
- angle
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.geometry.view.ScaleView(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Create a 2D scale matrix.
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- x
- y
- class pixelpipes.geometry.view.TranslateView(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Create a 2D translation matrix.
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- x
- y
- class pixelpipes.geometry.view.ViewPoints(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Transforms points with a given view.
- Inputs:
source: A list of points
view: View type
Category: points
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- source
- view
- class pixelpipes.geometry.rectangle.GetElement(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Returns an element from a list for a given index
- index
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- parent
- class pixelpipes.geometry.rectangle.Graph(prefix: str | Reference | None = '')
-
- commit()
- copy()
- static default()
- static has_default()
- nodes()
- pipeline(variables=None, output=None)
- class pixelpipes.geometry.rectangle.Input(reftype: pixelpipes.types.Data, default: str | float | int | None = None, description: str | None = '')
- coerce(value, _)
- dump(value)
- reftype()
- class pixelpipes.geometry.rectangle.Macro(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class for all nodes in a computation graph.
- property context
- evaluate(**inputs)
Will not evaluate to a type, just return None
- abstract expand(**inputs)
- class pixelpipes.geometry.rectangle.MakeRectangle(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Creates a bounding box from four values.
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- x1
- x2
- y1
- y2
- class pixelpipes.geometry.rectangle.Operation(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class of all atomic nodes that generate pipeline operations
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.geometry.rectangle.PointsBounds(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Computes an axis aligned bounging box on a set of points
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- points
- class pixelpipes.geometry.rectangle.PointsCenter(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Computes center of point set as an average of all coordinates
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- source
- class pixelpipes.geometry.rectangle.PointsFromRectangle(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Convert bounding box to a list of points
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- source
- class pixelpipes.geometry.rectangle.RectangleArea(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Calculates and area under rectangle.
- expand(source)
- source
- class pixelpipes.geometry.rectangle.ResizeRectangle(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Scales existing rectangle by a factor.
- expand(source, factor)
- factor
- source
- pixelpipes.geometry.rectangle.outputs(*inputs, label='default')
Images
- pixelpipes.image.BorderStrategy
- pixelpipes.image.ColorConversion
- class pixelpipes.image.ColorConvert(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Converts image between color spaces.
- convert
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- source
- class pixelpipes.image.ConvertDepth(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Convert pixel depth of input image
- depth
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- source
- pixelpipes.image.DataType
- class pixelpipes.image.EnumerationInput(options, default=None, description='')
- coerce(value, _)
- dump(value)
- class pixelpipes.image.Equals(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Equal
Test if individual pixels match a value, returns binary mask
- Inputs:
source: source image
value: value to compare
Category: image, basic Tags: image
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- source
- value
- class pixelpipes.image.GetElement(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Returns an element from a list for a given index
- index
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- parent
- class pixelpipes.image.GetImageProperties(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Get image properties
Returns a structure of properties of the source image: width, height, channels, depth. All four elements are integers.
- Inputs:
source: Image for which properties are returned
Category: image
- expand(source)
- source
- pixelpipes.image.ImageChannels
- class pixelpipes.image.Input(reftype: pixelpipes.types.Data, default: str | float | int | None = None, description: str | None = '')
- coerce(value, _)
- dump(value)
- reftype()
- pixelpipes.image.InterpolationMode
- class pixelpipes.image.Invert(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Inverts image values
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- source
- class pixelpipes.image.LazyLoadEnum(name)
Special enum class used to load mappings from the core library when they are needed for the first time.
- class pixelpipes.image.Macro(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class for all nodes in a computation graph.
- property context
- evaluate(**inputs)
Will not evaluate to a type, just return None
- abstract expand(**inputs)
- class pixelpipes.image.Operation(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class of all atomic nodes that generate pipeline operations
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.image.Threshold(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Sets pixels with values above threshold to zero. Returns a binary image
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- source
- threshold
- pixelpipes.image.load_module(name)
- pixelpipes.image.loading.DataType
- class pixelpipes.image.loading.DecodeImage(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Read image from file with 8-bit per channel depth. Color or grayscale.
- buffer
- channels
- depth
- normalize
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.image.loading.DecodePNGPaletteIndices(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Decodes buffer as PNG as palette indices (no conversion to RGB)
- buffer
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- pixelpipes.image.loading.ImageChannels
- class pixelpipes.image.loading.Input(reftype: pixelpipes.types.Data, default: str | float | int | None = None, description: str | None = '')
- coerce(value, _)
- dump(value)
- reftype()
- class pixelpipes.image.loading.Operation(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class of all atomic nodes that generate pipeline operations
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.image.render.BinaryNoise(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Creates a single channel image where a random percentage of values are set to 1.
- height
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- positive
- seed
- width
- class pixelpipes.image.render.GaussianNoise(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Creates a single channel image with values sampled from gaussian distribution.
- height
- mean
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- seed
- std
- width
- class pixelpipes.image.render.Input(reftype: pixelpipes.types.Data, default: str | float | int | None = None, description: str | None = '')
- coerce(value, _)
- dump(value)
- reftype()
- class pixelpipes.image.render.LinearImage(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Generate an image with linearly progressing values from min to max.
- flip
- height
- max
- min
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- width
- class pixelpipes.image.render.Operation(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class of all atomic nodes that generate pipeline operations
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.image.render.PointsMask(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Generate a list of points for a polygon
- height
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- points
- size
- width
- class pixelpipes.image.render.PolygonMask(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Draw a polygon to a canvas of a given size
- height
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- source
- thickness
- width
- class pixelpipes.image.render.SeedInput(description='')
- class pixelpipes.image.render.UniformNoise(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Creates a single channel image with values sampled from uniform distribution.
- height
- max
- min
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- seed
- width
- class pixelpipes.image.filter.AverageFilter(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Convolving an image with a normalized box filter. Filtering is performed with two separate 1D filters.
- border
- expand(source, size_x, size_y, border)
- size_x
- size_y
- source
- class pixelpipes.image.filter.BilateralFilter(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Applies the bilateral filter to an image.
- diameter
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- sigma_color
- sigma_space
- source
- pixelpipes.image.filter.BorderStrategy
- class pixelpipes.image.filter.EnumerationInput(options, default=None, description='')
- coerce(value, _)
- dump(value)
- class pixelpipes.image.filter.GaussianFilter(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Blurs an image using a gaussian filter. Filtering is performed with two separate 1D filters.
- border
- expand(source, size_x, size_y, border)
- size_x
- size_y
- source
- class pixelpipes.image.filter.GaussianKernel(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Generate a Gaussian kernel
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- size
- class pixelpipes.image.filter.Input(reftype: pixelpipes.types.Data, default: str | float | int | None = None, description: str | None = '')
- coerce(value, _)
- dump(value)
- reftype()
- class pixelpipes.image.filter.LinearFilter(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Linear filter
Convolves an image with a custom kernel.
- Inputs:
source: source image
kernel: custom kernel
Category: image, filters Tags: image, filter
- border
- kernel
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- source
- class pixelpipes.image.filter.Macro(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class for all nodes in a computation graph.
- property context
- evaluate(**inputs)
Will not evaluate to a type, just return None
- abstract expand(**inputs)
- class pixelpipes.image.filter.MedianBlur(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Blurs an image using a median filter.
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- size
- source
- class pixelpipes.image.filter.Operation(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class of all atomic nodes that generate pipeline operations
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.image.filter.Transpose(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Transposes image, switching width for height
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- source
- class pixelpipes.image.filter.UniformKernel(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Generate a uniform kernel
- Inputs:
size:
Category: image, filters Tags: image, filter
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- size
- class pixelpipes.image.processing.DerivativeX(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Computes the derivative of an image in the x direction.
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- source
- class pixelpipes.image.processing.DerivativeY(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Computes the derivative of an image in the y direction.
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- source
- class pixelpipes.image.processing.DistanceTransform(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Computes the distance transform of an image.
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- source
- class pixelpipes.image.processing.Edges(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Computes the edges of an image.
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- source
- threshold1
- threshold2
- class pixelpipes.image.processing.ImageBlend(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Image blend
Blends two images with weight defined by alpha.
- a
- alpha
- b
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.image.processing.ImageCoarseDropout(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Divides an image into patches and cuts them with probability p.
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- probability
- seed
- size
- source
- class pixelpipes.image.processing.ImageCut(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Sets a given rectangular region in an image to zero.
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- region
- source
- class pixelpipes.image.processing.ImageDropout(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Sets image pixels to zero with probability p.
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- probability
- seed
- source
- class pixelpipes.image.processing.ImageNormalize(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Normalizes values between a range determined by the type of image elements, for integer types this is min-max of the type, for float it is 0 and 1.
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- source
- class pixelpipes.image.processing.ImageSolarize(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Invert all values above a threshold in images.
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- source
- threshold
- class pixelpipes.image.processing.Input(reftype: pixelpipes.types.Data, default: str | float | int | None = None, description: str | None = '')
- coerce(value, _)
- dump(value)
- reftype()
- class pixelpipes.image.processing.Laplacian(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Computes the Laplacian of an image.
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- source
- class pixelpipes.image.processing.Operation(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class of all atomic nodes that generate pipeline operations
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.image.processing.SeedInput(description='')
- class pixelpipes.image.augmentation.Add(*args, **kwargs)
Base class of all atomic nodes that generate pipeline operations
- a
- b
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- saturate
- class pixelpipes.image.augmentation.Convert(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Converts input to different primitive data type.
- dtype
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- source
- class pixelpipes.image.augmentation.ConvertDepth(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Convert pixel depth of input image
- depth
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- source
- class pixelpipes.image.augmentation.GaussianNoise(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Creates a single channel image with values sampled from gaussian distribution.
- height
- mean
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- seed
- std
- width
- class pixelpipes.image.augmentation.GetImageProperties(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Get image properties
Returns a structure of properties of the source image: width, height, channels, depth. All four elements are integers.
- Inputs:
source: Image for which properties are returned
Category: image
- expand(source)
- source
- class pixelpipes.image.augmentation.ImageBrightness(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Change image brightness
- amount
- expand(source, amount)
- source
- class pixelpipes.image.augmentation.ImageNoise(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Apply gaussian noise to an image
- amount
- expand(source, amount, seed)
- seed
- source
- class pixelpipes.image.augmentation.ImagePiecewiseAffine(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Piecewise affine transformation of image. This augmentation creates a grid of random perturbations and interpolates this transformation over the entire image.
- amount
- expand(source, amount, seed)
- seed
- source
- subdivision
- class pixelpipes.image.augmentation.ImageRemap(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Remap image pixels based on given X any Y map using interpoation.
- border
- interpolation
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- source
- x
- y
- class pixelpipes.image.augmentation.Input(reftype: pixelpipes.types.Data, default: str | float | int | None = None, description: str | None = '')
- coerce(value, _)
- dump(value)
- reftype()
- class pixelpipes.image.augmentation.LinearImage(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Generate an image with linearly progressing values from min to max.
- flip
- height
- max
- min
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- width
- class pixelpipes.image.augmentation.Macro(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class for all nodes in a computation graph.
- property context
- evaluate(**inputs)
Will not evaluate to a type, just return None
- abstract expand(**inputs)
- class pixelpipes.image.augmentation.Resize(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Resize image to given width and height.
- height
- interpolation
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- source
- width
- class pixelpipes.image.augmentation.SeedInput(description='')
- class pixelpipes.image.augmentation.UniformNoise(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Creates a single channel image with values sampled from uniform distribution.
- height
- max
- min
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- seed
- width
- pixelpipes.image.geometry.BorderStrategy
- class pixelpipes.image.geometry.EnsureSize(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Ensures that the image has at least specific size.
- expand(source, width, height)
- height
- source
- width
- class pixelpipes.image.geometry.EnumerationInput(options, default=None, description='')
- coerce(value, _)
- dump(value)
- class pixelpipes.image.geometry.Flip(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Flips image around vertical, horizontal, or both axes.
- horizontal
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- source
- vertical
- class pixelpipes.image.geometry.GetImageProperties(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Get image properties
Returns a structure of properties of the source image: width, height, channels, depth. All four elements are integers.
- Inputs:
source: Image for which properties are returned
Category: image
- expand(source)
- source
- class pixelpipes.image.geometry.ImageCrop(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Crops an image to a given rectangle
- height
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- source
- width
- x
- y
- class pixelpipes.image.geometry.ImageCropSafe(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Crops an image to a given rectangle
- border
- height
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- source
- width
- x
- y
- class pixelpipes.image.geometry.ImageRemap(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Remap image pixels based on given X any Y map using interpoation.
- border
- interpolation
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- source
- x
- y
- class pixelpipes.image.geometry.Input(reftype: pixelpipes.types.Data, default: str | float | int | None = None, description: str | None = '')
- coerce(value, _)
- dump(value)
- reftype()
- pixelpipes.image.geometry.InterpolationMode
- class pixelpipes.image.geometry.Macro(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class for all nodes in a computation graph.
- property context
- evaluate(**inputs)
Will not evaluate to a type, just return None
- abstract expand(**inputs)
- class pixelpipes.image.geometry.MaskBoundingBox(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Compute a bounding box of non-zero pixels in a single-channel image and returns bounding box.
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- source
- class pixelpipes.image.geometry.Operation(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class of all atomic nodes that generate pipeline operations
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.image.geometry.RandomPatchView(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Returns a view that focuses on a random patch in an image
- expand(source, width, height, padding, seed)
- height
- padding
- seed
- source
- width
- class pixelpipes.image.geometry.Resize(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Resize image to given width and height.
- height
- interpolation
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- source
- width
- class pixelpipes.image.geometry.SampleUnform(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Samples random value between min and max value.
- max
- min
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- seed
- class pixelpipes.image.geometry.Scale(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Scales an image defined by scale factor.
- interpolation
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- scale
- source
- class pixelpipes.image.geometry.SeedInput(description='')
- class pixelpipes.image.geometry.TranslateView(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Create a 2D translation matrix.
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- x
- y
- class pixelpipes.image.geometry.Transpose(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Transposes image, switching width for height
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- source
- class pixelpipes.image.geometry.ViewImage(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Apply a linear transformation to an image and generate a new image based on it.
- border
- height
- interpolation
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- source
- view
- width
Resources
- class pixelpipes.resource.AliasField(field: str)
- access(parent: pixelpipes.graph.InferredReference)
- class pixelpipes.resource.Anything
Denotes type that accepts all inputs.
- class pixelpipes.resource.AppendField(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Produce a resource from an input resource and another field. Essentially just node renaming.
- expand(source, value)
- name
- source
- value
- class pixelpipes.resource.ConditionalField(true_field: ResourceField, false_field: ResourceField, true_filter: str, false_filter: str, condition: pixelpipes.graph.Reference)
- access(parent: pixelpipes.graph.InferredReference)
- class pixelpipes.resource.ConditionalResource(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
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.
- condition
- expand(true, false, condition)
- false
- true
- class pixelpipes.resource.Copy(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Copy node is a special node that copies the input to the output. It is not an operation or a macro, it is only used as a helper and is removed during compilation.
- source
- class pixelpipes.resource.CopyResource(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class for all nodes in a computation graph.
- expand(source)
- source
- class pixelpipes.resource.Data
Abstract type base, represents description of token types accepted or returned by nodes.
- class pixelpipes.resource.GetField(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
This macro exposes only selected field of an input structure as an output, enabling processing of that data.
- element
- expand(source)
- source
- pixelpipes.resource.IMAGE_FIELD = 'image'
- class pixelpipes.resource.InferredReference(ref: str, data)
A node reference with type or value already inferred. Used during compilation and in macro expansion.
- property type
- class pixelpipes.resource.Input(reftype: pixelpipes.types.Data, default: str | float | int | None = None, description: str | None = '')
- coerce(value, _)
- dump(value)
- reftype()
- pixelpipes.resource.Integer()
- pixelpipes.resource.MASK_FIELD = 'mask'
- class pixelpipes.resource.Macro(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class for all nodes in a computation graph.
- property context
- evaluate(**inputs)
Will not evaluate to a type, just return None
- abstract expand(**inputs)
- class pixelpipes.resource.MakeResource(*args, **kwargs)
Macro that generates a resource from given inputs
- expand(**inputs)
- get_inputs()
- input_values()
- inputs
- class pixelpipes.resource.Node(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class for all nodes in a computation graph.
- duplicate(_name=None, _origin=None, **inputs)
- evaluate(**inputs)
- property frame
- get_inputs()
- input_names()
- input_types()
- input_values()
- classmethod name()
- property origin
Only relevant for nodes generated during compilation, makes it easier to track original node from the source graph. Returns None in other cases.
- class pixelpipes.resource.NodeOperation(*args, **kwds)
Create a collection of name/value pairs.
Example enumeration:
>>> class Color(Enum): ... RED = 1 ... BLUE = 2 ... GREEN = 3
Access them by:
attribute access:
>>> Color.RED <Color.RED: 1>
value lookup:
>>> Color(1) <Color.RED: 1>
name lookup:
>>> Color['RED'] <Color.RED: 1>
Enumerations can be iterated over, and know how many members they have:
>>> len(Color) 3
>>> list(Color) [<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]
Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.
- ADD
- DIVIDE
- EQUAL
- GREATER
- GREATER_EQUAL
- INDEX
- LENGTH
- LOGICAL_AND
- LOGICAL_NOT
- LOGICAL_OR
- LOWER
- LOWER_EQUAL
- MODULO
- MULIPLY
- NEGATE
- NOT_EQUAL
- POWER
- SUBTRACT
- pixelpipes.resource.POINTS_FIELD = 'points'
- class pixelpipes.resource.Resource(**fields: Dict[str, ResourceField])
Support for virtual resource types. Resource is essentially a flat structure key-value type that simplifies handling several inputs in parallel. Their purpose is to structure dataflow at the graph level but get dissolved once the graph is compiled.
- access(field: str, parent: pixelpipes.graph.Reference)
- castable(typ: pixelpipes.types.Data)
Checks if one resource type can be cast to another, this means that the parameter type has all the fields of this type and that all field types can be casted to their corresponding field types.
- Args:
typ (Type): Type to test for compatibility
- Returns:
bool: True if type is compatible
- common(typ: pixelpipes.types.Data)
Merge two types by finding their common type. By default this just looks if one type is castable into the other.
- fields()
- typehint(field: str)
- class pixelpipes.resource.ResourceField(typ: pixelpipes.types.Data, purpose: str | None = None)
- access(parent: pixelpipes.graph.InferredReference)
- property purpose
- reference(parent: pixelpipes.graph.InferredReference)
- property type
- class pixelpipes.resource.Token(element=None, *shape)
Abstract type base, represents description of token types accepted or returned by nodes.
- common(typ: Data)
Merge two types by finding their common type. By default this just looks if one type is castable into the other.
- property element
- pop()
- push(length=None)
- property rank
- squeeze()
- class pixelpipes.resource.TokenField(field: str)
- access(parent: pixelpipes.graph.InferredReference)
- reference(parent: pixelpipes.graph.InferredReference)
- exception pixelpipes.resource.TypeException
Common base class for all non-exit exceptions.
- exception pixelpipes.resource.ValidationException(*args, node: Node | None = None)
Common base class for all non-exit exceptions.
- class pixelpipes.resource.Wildcard(element=None, mindim=None, maxdim=None)
Abstract type base, represents description of token types accepted or returned by nodes.
- pixelpipes.resource.real_field(field)
- class pixelpipes.resource.list.Constant(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Generates a constant in the pipeline
- key()
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- static resolve_type(value)
- value
- class pixelpipes.resource.list.Copy(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Copy node is a special node that copies the input to the output. It is not an operation or a macro, it is only used as a helper and is removed during compilation.
- source
- class pixelpipes.resource.list.FileList
Built-in mutable sequence.
If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified.
- class pixelpipes.resource.list.FileListConstant(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
String list of file patchs. Use this operation to inject file dependencies into the pipeline.
- list
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.resource.list.GetElement(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Returns an element from a list for a given index
- index
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- parent
- class pixelpipes.resource.list.GetLastResource(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class for all nodes in a computation graph.
- expand(resources)
- resources
- class pixelpipes.resource.list.GetResource(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class for all nodes in a computation graph.
- expand(resources, index)
- index
- resources
- class pixelpipes.resource.list.GetResourceListLength(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class for all nodes in a computation graph.
- expand(resources)
- resources
- class pixelpipes.resource.list.Input(reftype: pixelpipes.types.Data, default: str | float | int | None = None, description: str | None = '')
- coerce(value, _)
- dump(value)
- reftype()
- class pixelpipes.resource.list.Integer(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Converts input to integer. A utility macro for Convert operation.
- expand(source)
- source
- class pixelpipes.resource.list.ListInterval(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class for all nodes in a computation graph.
- begin
- end
- expand(resources, begin, end)
- resources
- class pixelpipes.resource.list.Macro(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class for all nodes in a computation graph.
- property context
- evaluate(**inputs)
Will not evaluate to a type, just return None
- abstract expand(**inputs)
- class pixelpipes.resource.list.Node(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class for all nodes in a computation graph.
- duplicate(_name=None, _origin=None, **inputs)
- evaluate(**inputs)
- property frame
- get_inputs()
- input_names()
- input_types()
- input_values()
- classmethod name()
- property origin
Only relevant for nodes generated during compilation, makes it easier to track original node from the source graph. Returns None in other cases.
- class pixelpipes.resource.list.NodeOperation(*args, **kwds)
Create a collection of name/value pairs.
Example enumeration:
>>> class Color(Enum): ... RED = 1 ... BLUE = 2 ... GREEN = 3
Access them by:
attribute access:
>>> Color.RED <Color.RED: 1>
value lookup:
>>> Color(1) <Color.RED: 1>
name lookup:
>>> Color['RED'] <Color.RED: 1>
Enumerations can be iterated over, and know how many members they have:
>>> len(Color) 3
>>> list(Color) [<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]
Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.
- ADD
- DIVIDE
- EQUAL
- GREATER
- GREATER_EQUAL
- INDEX
- LENGTH
- LOGICAL_AND
- LOGICAL_NOT
- LOGICAL_OR
- LOWER
- LOWER_EQUAL
- MODULO
- MULIPLY
- NEGATE
- NOT_EQUAL
- POWER
- SUBTRACT
- class pixelpipes.resource.list.Permutation(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Generates a list of numbers from 0 to length in random order.
- length
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- seed
- class pixelpipes.resource.list.PermuteResourceSegments(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class for all nodes in a computation graph.
- expand(resources, seed)
- resources
- seed
- class pixelpipes.resource.list.PermuteResources(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Randomly permutes the resource list
- expand(resources)
- resources
- class pixelpipes.resource.list.PersistentDict(root: str)
A dictionary interface to a folder, with memory caching.
- class pixelpipes.resource.list.RandomResource(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Select a random resource from an input list of resources
- expand(resources, seed)
- resources
- seed
- class pixelpipes.resource.list.RandomResourceSegment(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class for all nodes in a computation graph.
- expand(resources, seed)
- resources
- seed
- class pixelpipes.resource.list.Remap(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Maps elements from source list to a result list using indices from indices list.
- indices
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- source
- class pixelpipes.resource.list.Repeat(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Repeat list element a number of times
- length
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- source
- class pixelpipes.resource.list.RepeatResource(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Returns a list of resources where an input resource is repeated a number of times
- expand(resource, length)
- length
- resource
- class pixelpipes.resource.list.Resource(**fields: Dict[str, ResourceField])
Support for virtual resource types. Resource is essentially a flat structure key-value type that simplifies handling several inputs in parallel. Their purpose is to structure dataflow at the graph level but get dissolved once the graph is compiled.
- access(field: str, parent: pixelpipes.graph.Reference)
- castable(typ: pixelpipes.types.Data)
Checks if one resource type can be cast to another, this means that the parameter type has all the fields of this type and that all field types can be casted to their corresponding field types.
- Args:
typ (Type): Type to test for compatibility
- Returns:
bool: True if type is compatible
- common(typ: pixelpipes.types.Data)
Merge two types by finding their common type. By default this just looks if one type is castable into the other.
- fields()
- typehint(field: str)
- class pixelpipes.resource.list.ResourceField(typ: pixelpipes.types.Data, purpose: str | None = None)
- access(parent: pixelpipes.graph.InferredReference)
- property purpose
- reference(parent: pixelpipes.graph.InferredReference)
- property type
- pixelpipes.resource.list.ResourceList(**fields: Mapping[str, pixelpipes.resource.ResourceField])
- class pixelpipes.resource.list.ResourceListSource(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Resource list source is an abstract macro that makes it easier to write resource list dataset providers. Implementations must implement load function that provides the data that is injected into a graph.
- expand()
- abstract load()
- class pixelpipes.resource.list.ResourceProxy(*args, _fields=None, **kwargs)
Base class for all nodes in a computation graph.
- evaluate(**inputs)
- get_inputs()
- input_values()
- inputs
- class pixelpipes.resource.list.ResourceSegment(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class for all nodes in a computation graph.
- expand(resources, index)
- index
- resources
- class pixelpipes.resource.list.SampleUnform(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Samples random value between min and max value.
- max
- min
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- seed
- class pixelpipes.resource.list.SeedInput(description='')
- class pixelpipes.resource.list.SegmentCount(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class for all nodes in a computation graph.
- expand(resources)
- resources
- pixelpipes.resource.list.SegmentedResourceList(**fields: Mapping[str, pixelpipes.resource.ResourceField])
- class pixelpipes.resource.list.SegmentedResourceListSource(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Resource list source is an abstract macro that makes it easier to write resource list dataset providers. Implementations must implement load function that provides the data that is injected into a graph.
- abstract load()
- class pixelpipes.resource.list.Sublist(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Selects a range from the source list as a new list.
- begin
- end
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- parent
- class pixelpipes.resource.list.TokenField(field: str)
- access(parent: pixelpipes.graph.InferredReference)
- reference(parent: pixelpipes.graph.InferredReference)
- exception pixelpipes.resource.list.ValidationException(*args, node: Node | None = None)
Common base class for all non-exit exceptions.
- pixelpipes.resource.list.is_resource_list(typ: pixelpipes.resource.types.Data)
- pixelpipes.resource.list.is_segmented_resource_list(typ: pixelpipes.resource.types.Data)
- pixelpipes.resource.list.make_hash(o)
makes a hash out of anything that contains only list,dict and hashable types including string and numeric types
- pixelpipes.resource.list.real_field(field)
- class pixelpipes.resource.loading.ColorConversion(*args, **kwds)
Create a collection of name/value pairs.
Example enumeration:
>>> class Color(Enum): ... RED = 1 ... BLUE = 2 ... GREEN = 3
Access them by:
attribute access:
>>> Color.RED <Color.RED: 1>
value lookup:
>>> Color(1) <Color.RED: 1>
name lookup:
>>> Color['RED'] <Color.RED: 1>
Enumerations can be iterated over, and know how many members they have:
>>> len(Color) 3
>>> list(Color) [<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]
Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.
- COLOR
- GRAYSCALE
- UNCHANGED
- pixelpipes.resource.loading.DataType
- class pixelpipes.resource.loading.DecodeImage(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Read image from file with 8-bit per channel depth. Color or grayscale.
- buffer
- channels
- depth
- normalize
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.resource.loading.FileList
Built-in mutable sequence.
If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified.
- pixelpipes.resource.loading.ImageChannels
- class pixelpipes.resource.loading.ImageDirectory(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Resource list source is an abstract macro that makes it easier to write resource list dataset providers. Implementations must implement load function that provides the data that is injected into a graph.
- channels
- depth
- filter
- load()
- path
- recursive
- sorted
- class pixelpipes.resource.loading.LoadImage(field: str, decoder: bool | None = None)
- access(parent)
- class pixelpipes.resource.loading.ReadFile(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Read file from disk to memory buffer. File is read in binary mode.
- filename
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.resource.loading.ResourceField(typ: pixelpipes.types.Data, purpose: str | None = None)
- access(parent: pixelpipes.graph.InferredReference)
- property purpose
- reference(parent: pixelpipes.graph.InferredReference)
- property type
- class pixelpipes.resource.loading.ResourceListSource(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Resource list source is an abstract macro that makes it easier to write resource list dataset providers. Implementations must implement load function that provides the data that is injected into a graph.
- expand()
- abstract load()
- class pixelpipes.resource.patch.CenterView(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Create a view that centers to a bounding box.
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- source
- class pixelpipes.resource.patch.Chain(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Multiply a series of views
- get_inputs()
- input_values()
- inputs
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- class pixelpipes.resource.patch.Copy(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Copy node is a special node that copies the input to the output. It is not an operation or a macro, it is only used as a helper and is removed during compilation.
- source
- class pixelpipes.resource.patch.FocusView(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Create a view that centers to a bounding box and scales so that bounding box maintains relative scale.
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- scale
- source
- class pixelpipes.resource.patch.Input(reftype: pixelpipes.types.Data, default: str | float | int | None = None, description: str | None = '')
- coerce(value, _)
- dump(value)
- reftype()
- class pixelpipes.resource.patch.Macro(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Base class for all nodes in a computation graph.
- property context
- evaluate(**inputs)
Will not evaluate to a type, just return None
- abstract expand(**inputs)
- class pixelpipes.resource.patch.MaskBoundingBox(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Compute a bounding box of non-zero pixels in a single-channel image and returns bounding box.
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- source
- class pixelpipes.resource.patch.PointsBounds(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Computes an axis aligned bounging box on a set of points
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- points
- class pixelpipes.resource.patch.Resource(**fields: Dict[str, ResourceField])
Support for virtual resource types. Resource is essentially a flat structure key-value type that simplifies handling several inputs in parallel. Their purpose is to structure dataflow at the graph level but get dissolved once the graph is compiled.
- access(field: str, parent: pixelpipes.graph.Reference)
- castable(typ: pixelpipes.types.Data)
Checks if one resource type can be cast to another, this means that the parameter type has all the fields of this type and that all field types can be casted to their corresponding field types.
- Args:
typ (Type): Type to test for compatibility
- Returns:
bool: True if type is compatible
- common(typ: pixelpipes.types.Data)
Merge two types by finding their common type. By default this just looks if one type is castable into the other.
- fields()
- typehint(field: str)
- class pixelpipes.resource.patch.ResourceCenter(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Center resource to the information in its field
- expand(resource, field, scale)
- field
- resource
- scale
- class pixelpipes.resource.patch.ResourceView(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Apply a view transform to resource fields (where possible, i.e. to images and points)
- expand(resource, view, width, height)
- height
- resource
- view
- width
- class pixelpipes.resource.patch.TranslateView(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Create a 2D translation matrix.
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- x
- y
- class pixelpipes.resource.patch.ViewImage(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)
Apply a linear transformation to an image and generate a new image based on it.
- border
- height
- interpolation
- operation()
Generates a operation construction data that is passed to the library
- Returns:
typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.
- source
- view
- width