Visualization Tools

Set of tools for visualizing observations and simulations.

phyre.creator.constants.NUM_COLORS = 7

Number of different colors used for objects in phyre simulations.

phyre.creator.constants.SCENE_HEIGHT = 256

Height of scene during simulation in pixels.

phyre.creator.constants.SCENE_WIDTH = 256

Width of scene during simulation in pixels.

phyre.observations_to_float_rgb(scene: numpy.ndarray, user_input: Tuple[Tuple[int, int], ...] = (), is_solved: Optional[bool] = None) → numpy.ndarray

Convert an observation as returned by a simulator to an image.

phyre.observations_to_uint8_rgb(scene: numpy.ndarray, user_input: Tuple[Tuple[int, int], ...] = (), is_solved: Optional[bool] = None) → numpy.ndarray

Convert an observation as returned by a simulator to an image.

phyre.featurized_objects_vector_to_raster(featurized_objects: numpy.ndarray) → numpy.ndarray

Convert featurized objects array to int array height x width of color codes.

Parameters

featurized_objects – np.ndarray of size (num_objects, OBJECT_FEATURE_SIZE)

Returns

A np.ndarray of size (SCENE_HEIGHT x SCENE_HEIGHT) of color codes,

consistent with Simulation.images returned by the simulator