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 (and an `exported-models-pytorch` directory for PyTorch models). Paramete
(
cfg_path: str,
shuffle: int = 1,
trainingsetindex: int = 0,
snapshotindex: int | None = None,
iteration: int = None,
TFGPUinference: bool = True,
overwrite: bool = False,
make_tar: bool = True,
wipepaths: bool = False,
without_detector: bool = False,
modelprefix: str = "",
engine: Engine | None = None,
)
| 1870 | |
| 1871 | |
| 1872 | def export_model( |
| 1873 | cfg_path: str, |
| 1874 | shuffle: int = 1, |
| 1875 | trainingsetindex: int = 0, |
| 1876 | snapshotindex: int | None = None, |
| 1877 | iteration: int = None, |
| 1878 | TFGPUinference: bool = True, |
| 1879 | overwrite: bool = False, |
| 1880 | make_tar: bool = True, |
| 1881 | wipepaths: bool = False, |
| 1882 | without_detector: bool = False, |
| 1883 | modelprefix: str = "", |
| 1884 | engine: Engine | None = None, |
| 1885 | ) -> None: |
| 1886 | """Export DeepLabCut models for the model zoo or for live inference. |
| 1887 | |
| 1888 | Saves the pose configuration, snapshot files, and frozen TF graph of the model to |
| 1889 | directory named exported-models within the project directory (and an |
| 1890 | `exported-models-pytorch` directory for PyTorch models). |
| 1891 | |
| 1892 | Parameters |
| 1893 | ----------- |
| 1894 | |
| 1895 | cfg_path : string |
| 1896 | path to the DLC Project config.yaml file |
| 1897 | |
| 1898 | shuffle : int, optional |
| 1899 | the shuffle of the model to export. default = 1 |
| 1900 | |
| 1901 | trainingsetindex : int, optional |
| 1902 | the index of the training fraction for the model you wish to export. default = 1 |
| 1903 | |
| 1904 | snapshotindex : int, optional |
| 1905 | the snapshot index for the weights you wish to export. If None, |
| 1906 | uses the snapshotindex as defined in 'config.yaml'. Default = None |
| 1907 | |
| 1908 | iteration : int, optional |
| 1909 | The model iteration (active learning loop) you wish to export. If None, |
| 1910 | the iteration listed in the config file is used. |
| 1911 | |
| 1912 | TFGPUinference : bool, optional |
| 1913 | use the tensorflow inference model? Default = True |
| 1914 | For inference using DeepLabCut-live, it is recommended to set TFGPIinference=False |
| 1915 | |
| 1916 | overwrite : bool, optional |
| 1917 | if the model you wish to export has already been exported, whether to overwrite. default = False |
| 1918 | |
| 1919 | make_tar : bool, optional |
| 1920 | Do you want to compress the exported directory to a tar file? Default = True |
| 1921 | This is necessary to export to the model zoo, but not for live inference. |
| 1922 | |
| 1923 | wipepaths : bool, optional |
| 1924 | Removes the actual path of your project and the init_weights from pose_cfg. |
| 1925 | |
| 1926 | without_detector: bool, optional |
| 1927 | PyTorch engine only. Exports top-down models without the detector. |
| 1928 | |
| 1929 | engine: Engine, optional, default = None. |
nothing calls this directly
no test coverage detected