confmaps
sleap.gui.overlays.confmaps
¶
GUI overlay for confidence maps (not currently used).
Previously, a DataOverlay class retrieved data from a model (i.e., it ran inference
on the current frame) and then used a ConfMapsPlot object to show the resulting
confidence maps.
Example: ::
>>> cm = ConfMapsPlot(conf_data.get_frame(0))
>>> window.view.scene.addItem(cm)
Classes:
| Name | Description |
|---|---|
ConfMapPlot |
QGraphicsPixmapItem object for drawing single channel of confidence map. |
ConfMapsPlot |
QGraphicsObject to display multiple confidence maps in a QGraphicsView. |
Functions:
| Name | Description |
|---|---|
demo_confmaps |
Demo function. |
show_confmaps_from_h5 |
Demo function. |
ConfMapPlot
¶
Bases: QGraphicsPixmapItem
QGraphicsPixmapItem object for drawing single channel of confidence map.
Not currently used.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
confmap
|
array
|
(h, w) array of one confidence map channel. |
None
|
color
|
list
|
optional (r, g, b) array for channel color. |
[255, 255, 255]
|
Returns:
| Type | Description |
|---|---|
|
None. |
Note
In most cases this should only be called by ConfMapsPlot.
Methods:
| Name | Description |
|---|---|
get_conf_image |
Converts array data stored in object to QImage. |
Source code in sleap/gui/overlays/confmaps.py
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 | |
get_conf_image()
¶
Converts array data stored in object to QImage.
Returns:
| Type | Description |
|---|---|
QImage
|
QImage. |
Source code in sleap/gui/overlays/confmaps.py
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 | |
ConfMapsPlot
¶
Bases: QGraphicsObject
QGraphicsObject to display multiple confidence maps in a QGraphicsView.
Not currently used.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frame
|
array
|
Data for one frame of confidence map data. Shape of array should be (channels, height, width). |
None
|
show
|
list
|
List of channels to show. If None, show all channels. |
None
|
show_box
|
bool
|
Draw bounding box around confidence maps. |
True
|
Returns:
| Type | Description |
|---|---|
|
None. |
When initialized, creates one child ConfMapPlot item for each channel.
Methods:
| Name | Description |
|---|---|
boundingRect |
Method required by Qt. |
paint |
Method required by Qt. |
Source code in sleap/gui/overlays/confmaps.py
22 23 24 25 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 | |
boundingRect()
¶
Method required by Qt.
Source code in sleap/gui/overlays/confmaps.py
62 63 64 | |
paint(painter, option, widget=None)
¶
Method required by Qt.
Source code in sleap/gui/overlays/confmaps.py
66 67 68 | |
demo_confmaps(confmaps, video, scale=None, standalone=False, callback=None)
¶
Demo function.
Source code in sleap/gui/overlays/confmaps.py
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | |
show_confmaps_from_h5(filename, input_format='channels_last', standalone=False)
¶
Demo function.
Source code in sleap/gui/overlays/confmaps.py
131 132 133 134 135 136 137 138 139 140 141 142 143 | |