class ColorScheme(EmbeddedDocument): (source)
Constructor: ColorScheme(*args, **kwargs)
Description of a color scheme in the App.
Example:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") # Store a custom color scheme for a dataset dataset.app_config.color_scheme = fo.ColorScheme( color_by="value", color_pool=[ "#ff0000", "#00ff00", "#0000ff", "pink", "yellowgreen", ], fields=[ { "path": "ground_truth", "fieldColor": "#ff00ff", "colorByAttribute": "label", "valueColors": [{"value": "dog", "color": "yellow"}], "maskTargetsColors": [ {"intTarget": 2, "color": "#ff0000"}, {"intTarget": 12, "color": "#99ff00"}, ], } ], label_tags={ "fieldColor": "#00ffff", "valueColors": [ {"value": "correct", "color": "#ff00ff"}, {"value": "mistake", "color": "#00ff00"}, ], }, colorscales=[ { "path": "heatmap1", "list": [ {"value": 0, "color": "rgb(0, 0, 255)"}, {"value": 1, "color": "rgb(0, 255, 255)"}, ], }, { "path": "heatmap2", "name": "hsv", }, ], multicolor_keypoints=False, opacity=0.5, show_skeletons=True, default_mask_targets_colors=[ {"intTarget": 1, "color": "#FEC0AA"}, {"intTarget": 2, "color": "#EC4E20"}, ], default_colorscale={"name": "sunset", "list": None}, ) session = fo.launch_app(dataset)
Parameters | |
color | whether annotations should be colored by "field", "value", or "instance" |
color | an optional list of colors to use as a color pool for this dataset |
multicolor | whether to use multiple colors for keypoints |
opacity | transparency of the annotation, between 0 and 1 |
show | whether to show skeletons of keypoints |
fields | an optional list of dicts of per-field custom colors with the following keys:
|
default | a list of dicts with the following keys specifying index and color for 2D masks of the dataset. If a field does not have field specific mask targets colors, this list will be used:
Note that the pixel value 0 is a reserved "background" class that is always rendered as invisible in the App |
default | dataset default colorscale dict with the following keys:
|
colorscales | an optional list of dicts of per-field custom colorscales with the following keys:
|
label | an optional dict specifying custom colors for label tags with the following keys:
|
Class Variable | color |
Undocumented |
Class Variable | color |
Undocumented |
Class Variable | colorscales |
Undocumented |
Class Variable | default |
Undocumented |
Class Variable | default |
Undocumented |
Class Variable | fields |
Undocumented |
Class Variable | label |
Undocumented |
Class Variable | meta |
Undocumented |
Class Variable | multicolor |
Undocumented |
Class Variable | opacity |
Undocumented |
Class Variable | show |
Undocumented |
Instance Variable | id |
Undocumented |
Method | _id |
Undocumented |
Method | _validate |
Undocumented |
Method | _validate |
Undocumented |
Method | _validate |
Undocumented |
Method | _validate |
Undocumented |
Method | _validate |
Undocumented |
Method | _validate |
Undocumented |
Method | _validate |
Undocumented |
Method | _validate |
Undocumented |
Method | _validate |
Undocumented |
Property | _id |
Undocumented |
Inherited from EmbeddedDocument
:
Method | __init__ |
Undocumented |
Inherited from MongoEngineBaseDocument
(via EmbeddedDocument
, BaseEmbeddedDocument
):
Class Method | from |
Loads the document from a BSON/JSON dictionary. |
Method | __deepcopy__ |
Undocumented |
Method | __delattr__ |
Undocumented |
Method | __delitem__ |
Undocumented |
Method | clear |
Clears the field from the document. |
Method | field |
Undocumented |
Method | field |
Undocumented |
Method | get |
Gets the field of the document. |
Method | has |
Determines whether the document has a field of the given name. |
Method | set |
Sets the value of a field of the document. |
Method | to |
Serializes this document to a BSON/JSON dictionary. |
Property | field |
An ordered tuple of the public fields of this document. |
Method | _get |
Undocumented |
Method | _get |
Returns an ordered tuple of field names of this document. |
Method | _get |
Returns an ordered tuple of field names that should be included in the repr of the document. |
Method | _to |
Undocumented |
Instance Variable | _fields |
Undocumented |
Inherited from SerializableDocument
(via EmbeddedDocument
, BaseEmbeddedDocument
, MongoEngineBaseDocument
):
Class Method | from |
Loads the document from a JSON string. |
Method | __eq__ |
Undocumented |
Method | __repr__ |
Undocumented |
Method | __str__ |
Undocumented |
Method | copy |
Returns a deep copy of the document. |
Method | fancy |
Generates a customizable string representation of the document. |
Method | iter |
Returns an iterator over the (name, value) pairs of the public fields of the document. |
Method | merge |
Merges the contents of the given document into this document. |
Method | to |
Serializes the document to a JSON string. |