imagecat module

Image processing functionality based on Graphcat computational graphs, http://graphcat.readthedocs.io.

Add links between tasks in a graphcat.Graph.

This function calls-through to graphcat.Graph.add_links(), and is provided for symmetry with add_task().

imagecat.add_task(graph, name, fn, **parameters)[source]

Simplify setting-up graphcat tasks with parameters.

Virtually all non-trivial Imagecat operations have parameters that affect their operation. Because individually creating parameter tasks and linking them with the main task is tiresome and verbose, use this function instead.

Parameters
  • graph (graphcat.Graph, required) – The Graphcat graph where the new task will be created.

  • name (str, required) – The name of the new task.

  • fn (callable, required) – The Imagecat operation to use for the new task.

  • parameters (additional keyword arguments, optional) – Each extra keyword argument will be turned into a parameter task and linked with the main task. Each parameter name is created by concatenating name with the keyword name, separated by a slash “/”.

Returns

name – Name of the newly-created operation, which may be different than name.

Return type

str

imagecat.set_expression(graph, name, expression, locals={})[source]

Setup an expression task in a graphcat.Graph.

This function calls-through to graphcat.Graph.set_expression(), but provides a library of Imagecat-specific functionality that can be used by expressions.

Set links between tasks in a graphcat.Graph.

This function calls-through to graphcat.Graph.set_links(), and is provided for symmetry with add_task().

imagecat.unique_name(graph, name)[source]

Return name, modified to be unique within graph.

Parameters
  • graph (graphcat.Graph, required) – The graph where name will be used.

  • name (str, required) – Task name to be adjusted.