Conditioning#

Import

from scenet import Conditioning

Defined in

scenet.emit.export (source)

Install

pip install scenet

Since

0.12

Stability

Public: follows semantic versioning. Below 1.0, a minor release may change it, and the CHANGELOG says how.

class scenet.emit.export.Conditioning[source]#

Bases: object

A panel’s staging, exported for image models.

pose#

Each actor’s skeleton, OpenPose COCO-18 JSON.

Type:

str

boxes#

Each actor’s and figure’s box and phrase, GLIGEN style.

Type:

str

depth#

The panel’s planes as grey on black, white nearest, as SVG.

Type:

str

mask#

Each actor, figure and mass in its own colour, as SVG.

Type:

str

semantics#

What the panel holds, as JSON – structure, not a prompt.

Type:

str

Example

>>> import json
>>> from scenet import Conditioning, compile_source, render_conditioning
>>> exports = render_conditioning(compile_source("cast: {a: {reference: alice}}").core)
>>> isinstance(exports, Conditioning), sorted(json.loads(exports.semantics))[:2]
(True, ['actors', 'camera'])

See also

render_conditioning, which makes one.

files()[source]#

Each export by the suffix its file takes, in the order build writes them.

Example

>>> from scenet import compile_source, render_conditioning
>>> exports = render_conditioning(
...     compile_source("{cast: {a: {reference: alice}}}").core
... )
>>> [suffix for suffix, _ in exports.files()]
['.pose.json', '.boxes.json', '.depth.svg', '.mask.svg', '.semantics.json']
Return type:

tuple[tuple[str, str], ...]

__init__(pose, boxes, depth, mask, semantics)#