batch_display
BatchDisplay
¶
Bases: Trace
A Trace to display a batch of images.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image |
Optional[str]
|
Key corresponding to a batch of images to be displayed. |
None
|
text |
Optional[str]
|
Key corresponding to text to be printed in the center of the figure. |
None
|
masks |
Union[None, str, Tuple[str, Sequence[str]]]
|
Key corresponding to masks to be displayed over an image. May be accompanied by a sequence of mask labels
(1 per channel) if desired: ( |
None
|
bboxes |
Optional[str]
|
Key corresponding to bounding boxes to be displayed over the image. |
None
|
keypoints |
Union[None, str, Tuple[str, Sequence[str]]]
|
Key corresponding to keypoints to be displayed over the image. May be accompanied by a sequence of
keypoint labels (1 per keypoint) if desired: ( |
None
|
mask_threshold |
Optional[float]
|
If provided, any masks will be binarized based on the given threshold value (1 if > t, else 0). |
None
|
color_map |
Union[str, Tuple[str, str]]
|
How to color 1-channel images. Options from: https://plotly.com/python/builtin-colorscales/. If 2 strings are provided, the first will be used to color grey-scale images and the second will be used to color continuous (non-thresholded) masks. If a single string is provided it will be used for both image and masks. |
('gray', 'turbo')
|
title |
Optional[str]
|
The title of the generated figure. If None it defaults to any image/text/mask/bbox/keypoint key which was provided (in that order). |
None
|
batch_limit |
Optional[int]
|
A limit on the number of batch elements to display. |
None
|
frequency |
Union[None, int, str]
|
'batch', 'epoch', integer, or strings like '10s', '15e'. When using 'batch', writes the losses and metrics to TensorBoard after each batch. The same applies for 'epoch'. If using an integer, let's say 1000, the callback will write the metrics and losses to TensorBoard every 1000 samples. You can also use strings like '8s' to indicate every 8 steps or '5e' to indicate every 5 epochs. You can use None to default to matching the log printing frequency. |
None
|
save_dir |
Optional[str]
|
A directory into which to save images rather than displaying them. The file names will be formatted as |
None
|
mode |
Union[None, str, Iterable[str]]
|
What mode(s) to execute this Trace in. For example, "train", "eval", "test", or "infer". To execute regardless of mode, pass None. To execute in all modes except for a particular one, you can pass an argument like "!infer" or "!train". |
None
|
ds_id |
Union[None, str, Iterable[str]]
|
What dataset id(s) to execute this Trace in. To execute regardless of ds_id, pass None. To execute in all ds_ids except for a particular one, you can pass an argument like "!ds1". |
None
|
Source code in fastestimator/fastestimator/trace/io/batch_display.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
|