MCPcopy Index your code
hub / github.com/DeepLabCut/DeepLabCut / from_array

Method from_array

deeplabcut/core/inferenceutils.py:113–125  ·  view source on GitHub ↗
(cls, array)

Source from the content-addressed store, hash-verified

111
112 @classmethod
113 def from_array(cls, array):
114 n_bpts, n_cols = array.shape
115
116 # if a single coordinate is NaN for a bodypart, set all to NaN
117 array[np.isnan(array).any(axis=-1)] = np.nan
118
119 ass = cls(size=n_bpts)
120 ass.data[:, :n_cols] = array
121 visible = np.flatnonzero(~np.isnan(array).any(axis=1))
122 if n_cols < 3: # Only xy coordinates are being set
123 ass.data[visible, 2] = 1 # Set detection confidence to 1
124 ass._visible.update(visible)
125 return ass
126
127 @property
128 def xy(self):

Callers 3

_parse_ground_truth_dataFunction · 0.80
calc_map_from_objFunction · 0.80

Calls 1

updateMethod · 0.45

Tested by

no test coverage detected