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

Function export_model

deeplabcut/pose_estimation_tensorflow/export.py:201–326  ·  view source on GitHub ↗

Export DeepLabCut models for the model zoo or for live inference. Saves the pose configuration, snapshot files, and frozen TF graph of the model to directory named exported-models within the project directory Parameters ----------- cfg_path : string path to the DLC Pro

(
    cfg_path,
    shuffle=1,
    trainingsetindex=0,
    snapshotindex=None,
    iteration=None,
    TFGPUinference=True,
    overwrite=False,
    make_tar=True,
    wipepaths=False,
    modelprefix="",
)

Source from the content-addressed store, hash-verified

199
200
201def export_model(
202 cfg_path,
203 shuffle=1,
204 trainingsetindex=0,
205 snapshotindex=None,
206 iteration=None,
207 TFGPUinference=True,
208 overwrite=False,
209 make_tar=True,
210 wipepaths=False,
211 modelprefix="",
212):
213 """Export DeepLabCut models for the model zoo or for live inference.
214
215 Saves the pose configuration, snapshot files, and frozen TF graph of the model to
216 directory named exported-models within the project directory
217
218 Parameters
219 -----------
220
221 cfg_path : string
222 path to the DLC Project config.yaml file
223
224 shuffle : int, optional
225 the shuffle of the model to export. default = 1
226
227 trainingsetindex : int, optional
228 the index of the training fraction for the model you wish to export. default = 1
229
230 snapshotindex : int, optional
231 the snapshot index for the weights you wish to export. If None,
232 uses the snapshotindex as defined in 'config.yaml'. Default = None
233
234 iteration : int, optional
235 The model iteration (active learning loop) you wish to export. If None,
236 the iteration listed in the config file is used.
237
238 TFGPUinference : bool, optional
239 use the tensorflow inference model? Default = True
240 For inference using DeepLabCut-live, it is recommended to set TFGPIinference=False
241
242 overwrite : bool, optional
243 if the model you wish to export has already been exported, whether to overwrite. default = False
244
245 make_tar : bool, optional
246 Do you want to compress the exported directory to a tar file? Default = True
247 This is necessary to export to the model zoo, but not for live inference.
248
249 wipepaths : bool, optional
250 Removes the actual path of your project and the init_weights from pose_cfg.
251
252 Example:
253 --------
254 Export the first stored snapshot for model trained with shuffle 3:
255 >>> deeplabcut.export_model('/analysis/project/reaching-task/config.yaml',shuffle=3, snapshotindex=-1)
256 --------
257 """
258

Callers 1

export_modelFunction · 0.90

Calls 6

load_modelFunction · 0.85
tf_to_pbFunction · 0.85
itemsMethod · 0.80
read_configMethod · 0.45
openMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected