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

Function save_labeled_frame

deeplabcut/utils/visualization.py:258–273  ·  view source on GitHub ↗
(fig, image_path, dest_folder, belongs_to_train)

Source from the content-addressed store, hash-verified

256
257
258def save_labeled_frame(fig, image_path, dest_folder, belongs_to_train):
259 path = Path(image_path)
260 imagename = path.parts[-1]
261 imfoldername = path.parts[-2]
262 if belongs_to_train:
263 dest = "-".join(("Training", imfoldername, imagename))
264 else:
265 dest = "-".join(("Test", imfoldername, imagename))
266 full_path = os.path.join(dest_folder, dest)
267
268 # Windows throws error if file path is > 260 characters, can fix with prefix.
269 # See https://docs.microsoft.com/en-us/windows/desktop/fileio/naming-a-file#maximum-path-length-limitation
270 if len(full_path) >= 260 and os.name == "nt":
271 full_path = "\\\\?\\" + full_path
272 fig.subplots_adjust(left=0, bottom=0, right=1, top=1, wspace=0, hspace=0)
273 fig.savefig(full_path)
274
275
276def create_minimal_figure(dpi=100):

Callers 3

plot_gt_and_predictionsFunction · 0.90
plot_evaluation_resultsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected