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

Function save_data

deeplabcut/utils/auxiliaryfunctions.py:407–417  ·  view source on GitHub ↗

Save predicted data as h5 file and metadata as pickle file; created by predict_videos.py.

(PredicteData, metadata, dataname, pdindex, imagenames, save_as_csv)

Source from the content-addressed store, hash-verified

405
406
407def save_data(PredicteData, metadata, dataname, pdindex, imagenames, save_as_csv):
408 """Save predicted data as h5 file and metadata as pickle file; created by
409 predict_videos.py."""
410 DataMachine = pd.DataFrame(PredicteData, columns=pdindex, index=imagenames)
411 if save_as_csv:
412 print("Saving csv poses!")
413 DataMachine.to_csv(dataname.split(".h5")[0] + ".csv")
414 DataMachine.to_hdf(dataname, key="df_with_missing", format="table", mode="w")
415 with open(dataname.split(".h5")[0] + "_meta.pickle", "wb") as f:
416 # Pickle the 'data' dictionary using the highest protocol available.
417 pickle.dump(metadata, f, pickle.HIGHEST_PROTOCOL)
418
419
420def save_metadata(metadatafilename, data, trainIndices, testIndices, trainFraction):

Callers

nothing calls this directly

Calls 1

splitMethod · 0.45

Tested by

no test coverage detected