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

Function plot_and_save_labeled_frame

deeplabcut/utils/visualization.py:216–255  ·  view source on GitHub ↗
(
    DataCombined,
    ind,
    trainIndices,
    cfg,
    colors,
    comparisonbodyparts,
    DLCscorer,
    foldername,
    fig,
    ax,
    scaling=1,
)

Source from the content-addressed store, hash-verified

214
215
216def plot_and_save_labeled_frame(
217 DataCombined,
218 ind,
219 trainIndices,
220 cfg,
221 colors,
222 comparisonbodyparts,
223 DLCscorer,
224 foldername,
225 fig,
226 ax,
227 scaling=1,
228):
229 if isinstance(DataCombined.index[ind], tuple):
230 image_path = os.path.join(cfg["project_path"], *DataCombined.index[ind])
231 else:
232 image_path = os.path.join(cfg["project_path"], DataCombined.index[ind])
233 frame = io.imread(image_path)
234 if np.ndim(frame) > 2: # color image!
235 h, w, numcolors = np.shape(frame)
236 else:
237 h, w = np.shape(frame)
238 fig.set_size_inches(w / 100, h / 100)
239 ax.set_xlim(0, w)
240 ax.set_ylim(0, h)
241 ax.invert_yaxis()
242 ax = make_labeled_image(
243 frame,
244 DataCombined,
245 ind,
246 cfg["pcutoff"],
247 [cfg["scorer"], DLCscorer],
248 comparisonbodyparts,
249 colors,
250 cfg,
251 scaling=scaling,
252 ax=ax,
253 )
254 save_labeled_frame(fig, image_path, foldername, ind in trainIndices)
255 return ax
256
257
258def save_labeled_frame(fig, image_path, dest_folder, belongs_to_train):

Callers

nothing calls this directly

Calls 2

make_labeled_imageFunction · 0.85
save_labeled_frameFunction · 0.85

Tested by

no test coverage detected