diff --git a/NOTICE.yml b/NOTICE.yml index 9193521b7..8632f9786 100644 --- a/NOTICE.yml +++ b/NOTICE.yml @@ -1,11 +1,11 @@ # This notice file contains license headers for all code files # in the repository (currently all *.py files). -# +# # When updating headers, lower entries take precedence over higher # entries. For each header, include/exclude statements can be used # to define files to apply them to. # -# When adding code from an external repo, make sure to cover the +# When adding code from an external repo, make sure to cover the # added code files with the correct license header. # Main repository license @@ -20,7 +20,7 @@ Licensed under GNU Lesser General Public License v3.0 include: - 'deeplabcut/**/*.py' - - 'tests/**/*.py' + - 'tests/**/*.py' - 'examples/**/*.py' - 'docs/**/*.py' - 'conda-environments/**/*.yaml' @@ -61,13 +61,13 @@ # Tensorflow licenses - header: | Copyright 2019 The TensorFlow Authors. All Rights Reserved. - + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - + http://www.apache.org/licenses/LICENSE-2.0 - + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -85,7 +85,7 @@ You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -116,3 +116,23 @@ https://github.com/rwightman/pytorch-image-models/blob/main/timm/scheduler/scheduler_factory.py include: - deeplabcut/pose_tracking_pytorch/solver/scheduler_factory.py + - deeplabcut/pose_tracking_pytorch/model/backones/vit_pytorch.py + +# Reranking +- header: | + """ + CVPR2017 paper:Zhong Z, Zheng L, Cao D, et al. Re-ranking Person Re-identification with k-reciprocal Encoding[J]. 2017. + url:http://openaccess.thecvf.com/content_cvpr_2017/papers/Zhong_Re-Ranking_Person_Re-Identification_CVPR_2017_paper.pdf + Matlab version: https://github.com/zhunzhong07/person-re-ranking + + API + + probFea: all feature vectors of the query set (torch tensor) + probFea: all feature vectors of the gallery set (torch tensor) + k1,k2,lambda: parameters, the original paper is (k1=20,k2=6,lambda=0.3) + MemorySave: set to 'True' when using MemorySave mode + Minibatch: available when 'MemorySave' is 'True' + """ + + include: + - deeplabcut/pose_tracking_pytorch/trackingutils/reranking.py diff --git a/deeplabcut/__init__.py b/deeplabcut/__init__.py index ff0a60755..658a94df7 100644 --- a/deeplabcut/__init__.py +++ b/deeplabcut/__init__.py @@ -1,12 +1,14 @@ -""" -DeepLabCut2.0 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" import os @@ -121,4 +123,3 @@ find_outliers_in_raw_data, ) from deeplabcut.post_processing import filterpredictions, analyzeskeleton - diff --git a/deeplabcut/__main__.py b/deeplabcut/__main__.py index e856c3616..93b3f44b6 100644 --- a/deeplabcut/__main__.py +++ b/deeplabcut/__main__.py @@ -1,12 +1,14 @@ -""" -DeepLabCut2.0 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" try: import PySide6 diff --git a/deeplabcut/benchmark/__init__.py b/deeplabcut/benchmark/__init__.py index 5540a8468..2e70eae78 100644 --- a/deeplabcut/benchmark/__init__.py +++ b/deeplabcut/benchmark/__init__.py @@ -1,10 +1,13 @@ -# DeepLabCut2.0 Toolbox (deeplabcut.org) -# © A. & M. Mathis Labs -# https://github.com/AlexEMG/DeepLabCut +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# # Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS # -# https://github.com/AlexEMG/DeepLabCut/blob/master/AUTHORS # Licensed under GNU Lesser General Public License v3.0 +# import json diff --git a/deeplabcut/benchmark/__main__.py b/deeplabcut/benchmark/__main__.py index 627c68529..28aa6776f 100644 --- a/deeplabcut/benchmark/__main__.py +++ b/deeplabcut/benchmark/__main__.py @@ -1,10 +1,13 @@ -# DeepLabCut2.0 Toolbox (deeplabcut.org) -# © A. & M. Mathis Labs -# https://github.com/AlexEMG/DeepLabCut +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# # Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS # -# https://github.com/AlexEMG/DeepLabCut/blob/master/AUTHORS # Licensed under GNU Lesser General Public License v3.0 +# from deeplabcut.benchmark.cli import main diff --git a/deeplabcut/benchmark/base.py b/deeplabcut/benchmark/base.py index 74c20122f..b9465cf07 100644 --- a/deeplabcut/benchmark/base.py +++ b/deeplabcut/benchmark/base.py @@ -1,10 +1,13 @@ -# DeepLabCut2.0 Toolbox (deeplabcut.org) -# © A. & M. Mathis Labs -# https://github.com/AlexEMG/DeepLabCut +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# # Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS # -# https://github.com/AlexEMG/DeepLabCut/blob/master/AUTHORS # Licensed under GNU Lesser General Public License v3.0 +# """Base classes for benchmark and result definition diff --git a/deeplabcut/benchmark/benchmarks.py b/deeplabcut/benchmark/benchmarks.py index a51eac395..ee18e215c 100644 --- a/deeplabcut/benchmark/benchmarks.py +++ b/deeplabcut/benchmark/benchmarks.py @@ -1,10 +1,13 @@ -# DeepLabCut2.0 Toolbox (deeplabcut.org) -# © A. & M. Mathis Labs -# https://github.com/AlexEMG/DeepLabCut +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# # Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS # -# https://github.com/AlexEMG/DeepLabCut/blob/master/AUTHORS # Licensed under GNU Lesser General Public License v3.0 +# """Definition for official DeepLabCut benchmark tasks. diff --git a/deeplabcut/benchmark/cli.py b/deeplabcut/benchmark/cli.py index e42be6dfd..7515a8fda 100644 --- a/deeplabcut/benchmark/cli.py +++ b/deeplabcut/benchmark/cli.py @@ -1,10 +1,13 @@ -# DeepLabCut2.0 Toolbox (deeplabcut.org) -# © A. & M. Mathis Labs -# https://github.com/AlexEMG/DeepLabCut +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# # Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS # -# https://github.com/AlexEMG/DeepLabCut/blob/master/AUTHORS # Licensed under GNU Lesser General Public License v3.0 +# """Command line interface for DeepLabCut deeplabcut.benchmark.""" diff --git a/deeplabcut/benchmark/metrics.py b/deeplabcut/benchmark/metrics.py index 3369020b4..9976a786d 100644 --- a/deeplabcut/benchmark/metrics.py +++ b/deeplabcut/benchmark/metrics.py @@ -1,10 +1,13 @@ -# DeepLabCut2.0 Toolbox (deeplabcut.org) -# © A. & M. Mathis Labs -# https://github.com/AlexEMG/DeepLabCut +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# # Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS # -# https://github.com/AlexEMG/DeepLabCut/blob/master/AUTHORS # Licensed under GNU Lesser General Public License v3.0 +# """Evaluation metrics for the DeepLabCut benchmark.""" diff --git a/deeplabcut/benchmark/utils.py b/deeplabcut/benchmark/utils.py index 40aa2495d..bc1cd64d3 100644 --- a/deeplabcut/benchmark/utils.py +++ b/deeplabcut/benchmark/utils.py @@ -1,10 +1,13 @@ -# DeepLabCut2.0 Toolbox (deeplabcut.org) -# © A. & M. Mathis Labs -# https://github.com/AlexEMG/DeepLabCut +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# # Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS # -# https://github.com/AlexEMG/DeepLabCut/blob/master/AUTHORS # Licensed under GNU Lesser General Public License v3.0 +# """Helper functions in this file are not affected by the main repositories license. They are independent from the remainder of the benchmarking code. diff --git a/deeplabcut/cli.py b/deeplabcut/cli.py index f0169c708..8e411a86a 100644 --- a/deeplabcut/cli.py +++ b/deeplabcut/cli.py @@ -1,12 +1,14 @@ -""" -DeepLabCut2.0 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut -Please see AUTHORS for contributors. - -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# + from pathlib import Path import click diff --git a/deeplabcut/create_project/__init__.py b/deeplabcut/create_project/__init__.py index 5e83e4fc2..d87e92227 100644 --- a/deeplabcut/create_project/__init__.py +++ b/deeplabcut/create_project/__init__.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# from deeplabcut.create_project.add import add_new_videos from deeplabcut.create_project.demo_data import load_demo_data from deeplabcut.create_project.modelzoo import ( diff --git a/deeplabcut/create_project/add.py b/deeplabcut/create_project/add.py index 1d1495e32..d9df37c3a 100644 --- a/deeplabcut/create_project/add.py +++ b/deeplabcut/create_project/add.py @@ -1,12 +1,13 @@ -""" -DeepLabCut2.2 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut -Please see AUTHORS for contributors. - -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# def add_new_videos(config, videos, copy_videos=False, coords=None, extract_frames=False): @@ -74,7 +75,7 @@ def add_new_videos(config, videos, copy_videos=False, coords=None, extract_frame else: print("Copying the videos") shutil.copy(os.fspath(src), os.fspath(dst)) - + else: # creates the symlinks of the video and puts it in the videos directory. print("Attempting to create a symbolic link of the video ...") @@ -101,7 +102,7 @@ def add_new_videos(config, videos, copy_videos=False, coords=None, extract_frame print("{} moved to {}".format(src, dst)) videos = destinations - + if copy_videos: videos = destinations # in this case the *new* location should be added to the config file diff --git a/deeplabcut/create_project/demo_data.py b/deeplabcut/create_project/demo_data.py index eeb7e316f..c495c89ba 100644 --- a/deeplabcut/create_project/demo_data.py +++ b/deeplabcut/create_project/demo_data.py @@ -1,12 +1,13 @@ -""" -DeepLabCut2.2 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut -Please see AUTHORS for contributors. - -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import os from pathlib import Path @@ -17,17 +18,17 @@ def load_demo_data(config, createtrainingset=True): """ - Loads the demo data -- subset from trail-tracking data in Mathis et al. 2018. + Loads the demo data -- subset from trail-tracking data in Mathis et al. 2018. When loading, it sets paths correctly to run this project on your system - + Parameter ---------- config : string Full path of the config.yaml file of the provided demo dataset as a string. - createtrainingset : bool - Boolean variable indicating if a training set shall be created. - + createtrainingset : bool + Boolean variable indicating if a training set shall be created. + Example -------- >>> deeplabcut.load_demo_data('config.yaml') diff --git a/deeplabcut/create_project/modelzoo.py b/deeplabcut/create_project/modelzoo.py index a554d2581..13c0b1af0 100644 --- a/deeplabcut/create_project/modelzoo.py +++ b/deeplabcut/create_project/modelzoo.py @@ -1,12 +1,13 @@ -""" -DeepLabCut 2.1.8 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut - -Please see AUTHORS for contributors. -https://github.com/DeepLabCu/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import os from pathlib import Path @@ -14,30 +15,12 @@ import yaml import deeplabcut -from deeplabcut.utils import auxiliaryfunctions, auxfun_models - -Modeloptions = [ - "full_human", - "full_cat", - "full_dog", - "primate_face", - "mouse_pupil_vclose", - "horse_sideview", - "full_macaque", -] # just expand this list with new projects - -''' -Modeloptions = [ - "full_human", - "full_cat", - "full_dog", - "primate_face", - "mouse_pupil_vclose", - "horse_sideview", - "full_macaque", - "full_cheetah", -] # just expand this list with new projects -''' +from deeplabcut.utils import auxiliaryfunctions +from dlclibrary.dlcmodelzoo.modelzoo_download import ( + download_huggingface_model, + MODELOPTIONS, +) + def MakeTrain_pose_yaml(itemstochange, saveasconfigfile, defaultconfigfile): raw = open(defaultconfigfile).read() @@ -176,7 +159,7 @@ def create_pretrained_project( Users must format paths with either: r'C:\ OR 'C:\\ <- i.e. a double backslash \ \ ) """ - if model in globals()["Modeloptions"]: + if model in MODELOPTIONS: cwd = os.getcwd() cfg = deeplabcut.create_new_project( @@ -273,11 +256,7 @@ def create_pretrained_project( # Download the weights and put then in appropriate directory print("Downloading weights...") - - # AM: Rowland server down... - #auxfun_models.download_model(model, train_dir) - auxfun_models.download_hugginface_model(model, train_dir) - + download_huggingface_model(model, train_dir) pose_cfg = deeplabcut.auxiliaryfunctions.read_plainconfig(path_train_config) print(path_train_config) diff --git a/deeplabcut/create_project/new.py b/deeplabcut/create_project/new.py index 6c5d893be..e16406de2 100644 --- a/deeplabcut/create_project/new.py +++ b/deeplabcut/create_project/new.py @@ -1,12 +1,14 @@ -""" -DeepLabCut2.2 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut -Please see AUTHORS for contributors. - -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# + import os import shutil diff --git a/deeplabcut/create_project/new_3d.py b/deeplabcut/create_project/new_3d.py index b663a79b4..f95344b3e 100644 --- a/deeplabcut/create_project/new_3d.py +++ b/deeplabcut/create_project/new_3d.py @@ -1,12 +1,14 @@ -""" -DeepLabCut2.0 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut - -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# + import os from pathlib import Path diff --git a/deeplabcut/generate_training_dataset/__init__.py b/deeplabcut/generate_training_dataset/__init__.py index 528117c3e..05b0092d4 100644 --- a/deeplabcut/generate_training_dataset/__init__.py +++ b/deeplabcut/generate_training_dataset/__init__.py @@ -1,12 +1,14 @@ -""" -DeepLabCut2.0 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" from deeplabcut.generate_training_dataset.frame_extraction import * from deeplabcut.generate_training_dataset.trainingsetmanipulation import * diff --git a/deeplabcut/generate_training_dataset/frame_extraction.py b/deeplabcut/generate_training_dataset/frame_extraction.py index 906511dd3..8c5e63c96 100755 --- a/deeplabcut/generate_training_dataset/frame_extraction.py +++ b/deeplabcut/generate_training_dataset/frame_extraction.py @@ -1,12 +1,13 @@ -""" -DeepLabCut2.0 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut - -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# def select_cropping_area(config, videos=None): diff --git a/deeplabcut/generate_training_dataset/multiple_individuals_trainingsetmanipulation.py b/deeplabcut/generate_training_dataset/multiple_individuals_trainingsetmanipulation.py index ad36781d4..6f7fe7748 100755 --- a/deeplabcut/generate_training_dataset/multiple_individuals_trainingsetmanipulation.py +++ b/deeplabcut/generate_training_dataset/multiple_individuals_trainingsetmanipulation.py @@ -1,12 +1,13 @@ -""" -DeepLabCut2.2 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut - -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import os import os.path diff --git a/deeplabcut/generate_training_dataset/trainingsetmanipulation.py b/deeplabcut/generate_training_dataset/trainingsetmanipulation.py index bcd3e9d73..d04150aca 100755 --- a/deeplabcut/generate_training_dataset/trainingsetmanipulation.py +++ b/deeplabcut/generate_training_dataset/trainingsetmanipulation.py @@ -1,12 +1,14 @@ -""" -DeepLabCut2.0 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut - -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# + import math import logging import os @@ -771,7 +773,7 @@ def create_training_dataset( augmenter_type: string, optional, default=None Type of augmenter. Currently supported augmenters are - + * ``default`` * ``scalecrop`` * ``imgaug`` diff --git a/deeplabcut/gui/__init__.py b/deeplabcut/gui/__init__.py index 3007bfe7c..b5293ee24 100644 --- a/deeplabcut/gui/__init__.py +++ b/deeplabcut/gui/__init__.py @@ -1,15 +1,16 @@ -""" -DeepLabCut2.0 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut -Please see AUTHORS for contributors. +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 - -""" import os os.environ['QT_API'] = 'pyside6' import qtpy # Necessary unused import to properly store the env variable -BASE_DIR = os.path.dirname(__file__) \ No newline at end of file +BASE_DIR = os.path.dirname(__file__) diff --git a/deeplabcut/gui/components.py b/deeplabcut/gui/components.py index 7e9f731e5..f580f1ab7 100644 --- a/deeplabcut/gui/components.py +++ b/deeplabcut/gui/components.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# from PySide6 import QtWidgets from PySide6.QtCore import Qt from deeplabcut.gui.dlc_params import DLCParams diff --git a/deeplabcut/gui/dlc_params.py b/deeplabcut/gui/dlc_params.py index f7ab953c5..2a267aac6 100644 --- a/deeplabcut/gui/dlc_params.py +++ b/deeplabcut/gui/dlc_params.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# class DLCParams: VIDEOTYPES = [ "", diff --git a/deeplabcut/gui/launch_script.py b/deeplabcut/gui/launch_script.py index d92fbd03d..b4f81df33 100644 --- a/deeplabcut/gui/launch_script.py +++ b/deeplabcut/gui/launch_script.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# """ DeepLabCut2.0 Toolbox (deeplabcut.org) © A. & M. Mathis Labs diff --git a/deeplabcut/gui/media/__init__.py b/deeplabcut/gui/media/__init__.py index e69de29bb..2dd1b0602 100644 --- a/deeplabcut/gui/media/__init__.py +++ b/deeplabcut/gui/media/__init__.py @@ -0,0 +1,10 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# diff --git a/deeplabcut/gui/tabs/__init__.py b/deeplabcut/gui/tabs/__init__.py index b77c21012..d8fc51ad8 100644 --- a/deeplabcut/gui/tabs/__init__.py +++ b/deeplabcut/gui/tabs/__init__.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# from deeplabcut.gui.tabs.analyze_videos import AnalyzeVideos from deeplabcut.gui.tabs.create_project import ProjectCreator from deeplabcut.gui.tabs.create_training_dataset import CreateTrainingDataset diff --git a/deeplabcut/gui/tabs/analyze_videos.py b/deeplabcut/gui/tabs/analyze_videos.py index d5d580fce..9c6111374 100644 --- a/deeplabcut/gui/tabs/analyze_videos.py +++ b/deeplabcut/gui/tabs/analyze_videos.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# from functools import partial from PySide6 import QtWidgets from PySide6.QtCore import Qt diff --git a/deeplabcut/gui/tabs/create_project.py b/deeplabcut/gui/tabs/create_project.py index e9a501018..7a1fdd84f 100644 --- a/deeplabcut/gui/tabs/create_project.py +++ b/deeplabcut/gui/tabs/create_project.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import os from datetime import datetime diff --git a/deeplabcut/gui/tabs/create_training_dataset.py b/deeplabcut/gui/tabs/create_training_dataset.py index 05c844caf..5107c8968 100644 --- a/deeplabcut/gui/tabs/create_training_dataset.py +++ b/deeplabcut/gui/tabs/create_training_dataset.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import os from PySide6 import QtWidgets diff --git a/deeplabcut/gui/tabs/create_videos.py b/deeplabcut/gui/tabs/create_videos.py index 8e44439f0..a5313e636 100644 --- a/deeplabcut/gui/tabs/create_videos.py +++ b/deeplabcut/gui/tabs/create_videos.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# from PySide6 import QtWidgets from PySide6.QtCore import Qt diff --git a/deeplabcut/gui/tabs/evaluate_network.py b/deeplabcut/gui/tabs/evaluate_network.py index be12e0845..8034936db 100644 --- a/deeplabcut/gui/tabs/evaluate_network.py +++ b/deeplabcut/gui/tabs/evaluate_network.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import os import matplotlib.image as mpimg from matplotlib.backends.backend_qt5agg import ( diff --git a/deeplabcut/gui/tabs/extract_frames.py b/deeplabcut/gui/tabs/extract_frames.py index 3cbde1921..a86dcfc53 100644 --- a/deeplabcut/gui/tabs/extract_frames.py +++ b/deeplabcut/gui/tabs/extract_frames.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# from functools import partial from PySide6 import QtWidgets diff --git a/deeplabcut/gui/tabs/extract_outlier_frames.py b/deeplabcut/gui/tabs/extract_outlier_frames.py index f6de2a693..c1d17d158 100644 --- a/deeplabcut/gui/tabs/extract_outlier_frames.py +++ b/deeplabcut/gui/tabs/extract_outlier_frames.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# from PySide6 import QtWidgets from PySide6.QtCore import Qt diff --git a/deeplabcut/gui/tabs/label_frames.py b/deeplabcut/gui/tabs/label_frames.py index 216e7ead8..fe29941d8 100644 --- a/deeplabcut/gui/tabs/label_frames.py +++ b/deeplabcut/gui/tabs/label_frames.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import os from PySide6 import QtWidgets from PySide6.QtCore import Qt diff --git a/deeplabcut/gui/tabs/manage_project.py b/deeplabcut/gui/tabs/manage_project.py index f9f9eb964..12b840889 100644 --- a/deeplabcut/gui/tabs/manage_project.py +++ b/deeplabcut/gui/tabs/manage_project.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import os from PySide6.QtCore import Qt from PySide6.QtWidgets import ( diff --git a/deeplabcut/gui/tabs/open_project.py b/deeplabcut/gui/tabs/open_project.py index 1cc0dec84..80f3e7a62 100644 --- a/deeplabcut/gui/tabs/open_project.py +++ b/deeplabcut/gui/tabs/open_project.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import os from PySide6 import QtWidgets, QtCore diff --git a/deeplabcut/gui/tabs/refine_tracklets.py b/deeplabcut/gui/tabs/refine_tracklets.py index 1c271da04..cd31500e9 100644 --- a/deeplabcut/gui/tabs/refine_tracklets.py +++ b/deeplabcut/gui/tabs/refine_tracklets.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import os from pathlib import Path from PySide6 import QtWidgets diff --git a/deeplabcut/gui/tabs/train_network.py b/deeplabcut/gui/tabs/train_network.py index 278899524..0337d59d9 100644 --- a/deeplabcut/gui/tabs/train_network.py +++ b/deeplabcut/gui/tabs/train_network.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import os from pathlib import Path diff --git a/deeplabcut/gui/tabs/unsupervised_id_tracking.py b/deeplabcut/gui/tabs/unsupervised_id_tracking.py index 6313abfb0..fff865c4e 100644 --- a/deeplabcut/gui/tabs/unsupervised_id_tracking.py +++ b/deeplabcut/gui/tabs/unsupervised_id_tracking.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# from functools import partial from PySide6 import QtWidgets from PySide6.QtCore import Qt diff --git a/deeplabcut/gui/tabs/video_editor.py b/deeplabcut/gui/tabs/video_editor.py index 66b64be42..cec1e9208 100644 --- a/deeplabcut/gui/tabs/video_editor.py +++ b/deeplabcut/gui/tabs/video_editor.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import time from PySide6 import QtWidgets diff --git a/deeplabcut/gui/tracklet_toolbox.py b/deeplabcut/gui/tracklet_toolbox.py index 765827bb6..030623f04 100644 --- a/deeplabcut/gui/tracklet_toolbox.py +++ b/deeplabcut/gui/tracklet_toolbox.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import matplotlib.patches as patches import matplotlib.pyplot as plt import matplotlib.transforms as mtransforms diff --git a/deeplabcut/gui/utils.py b/deeplabcut/gui/utils.py index 18b722915..178e1ed01 100644 --- a/deeplabcut/gui/utils.py +++ b/deeplabcut/gui/utils.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# from PySide6 import QtCore diff --git a/deeplabcut/gui/widgets.py b/deeplabcut/gui/widgets.py index 66a1acf1d..c9ad3e4d6 100644 --- a/deeplabcut/gui/widgets.py +++ b/deeplabcut/gui/widgets.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import ast import os import warnings diff --git a/deeplabcut/gui/window.py b/deeplabcut/gui/window.py index a379b6b8f..dda2e0112 100644 --- a/deeplabcut/gui/window.py +++ b/deeplabcut/gui/window.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import os import logging import subprocess diff --git a/deeplabcut/pose_estimation_3d/__init__.py b/deeplabcut/pose_estimation_3d/__init__.py index fe9eea00f..81458685b 100644 --- a/deeplabcut/pose_estimation_3d/__init__.py +++ b/deeplabcut/pose_estimation_3d/__init__.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# from deeplabcut.pose_estimation_3d.camera_calibration import * from deeplabcut.pose_estimation_3d.plotting3D import * from deeplabcut.pose_estimation_3d.triangulation import * diff --git a/deeplabcut/pose_estimation_3d/camera_calibration.py b/deeplabcut/pose_estimation_3d/camera_calibration.py index 74d4ba91b..af0da8f8f 100644 --- a/deeplabcut/pose_estimation_3d/camera_calibration.py +++ b/deeplabcut/pose_estimation_3d/camera_calibration.py @@ -1,12 +1,13 @@ -""" -DeepLabCut2.0 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut - -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import glob import os @@ -27,13 +28,13 @@ def calibrate_cameras(config, cbrow=8, cbcol=6, calibrate=False, alpha=0.4): """This function extracts the corners points from the calibration images, calibrates the camera and stores the calibration files in the project folder (defined in the config file). - - Make sure you have around 20-60 pairs of calibration images. The function should be used iteratively to select the right set of calibration images. - - A pair of calibration image is considered "correct", if the corners are detected correctly in both the images. It may happen that during the first run of this function, + + Make sure you have around 20-60 pairs of calibration images. The function should be used iteratively to select the right set of calibration images. + + A pair of calibration image is considered "correct", if the corners are detected correctly in both the images. It may happen that during the first run of this function, the extracted corners are incorrect or the order of detected corners does not align for the corresponding views (i.e. camera-1 and camera-2 images). - - In such a case, remove those pairs of images and re-run this function. Once the right number of calibration images are selected, + + In such a case, remove those pairs of images and re-run this function. Once the right number of calibration images are selected, use the parameter ``calibrate=True`` to calibrate the cameras. Parameters @@ -43,25 +44,25 @@ def calibrate_cameras(config, cbrow=8, cbcol=6, calibrate=False, alpha=0.4): cbrow : int Integer specifying the number of rows in the calibration image. - + cbcol : int Integer specifying the number of columns in the calibration image. calibrate : bool If this is set to True, the cameras are calibrated with the current set of calibration images. The default is ``False`` Set it to True, only after checking the results of the corner detection method and removing dysfunctional images! - + alpha: float - Floating point number between 0 and 1 specifying the free scaling parameter. When alpha = 0, the rectified images with only valid pixels are stored - i.e. the rectified images are zoomed in. When alpha = 1, all the pixels from the original images are retained. + Floating point number between 0 and 1 specifying the free scaling parameter. When alpha = 0, the rectified images with only valid pixels are stored + i.e. the rectified images are zoomed in. When alpha = 1, all the pixels from the original images are retained. For more details: https://docs.opencv.org/2.4/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html - + Example -------- Linux/MacOs/Windows >>> deeplabcut.calibrate_camera(config) - Once the right set of calibration images are selected, + Once the right set of calibration images are selected, >>> deeplabcut.calibrate_camera(config,calibrate=True) """ @@ -284,8 +285,8 @@ def calibrate_cameras(config, cbrow=8, cbcol=6, calibrate=False, alpha=0.4): def check_undistortion(config, cbrow=8, cbcol=6, plot=True): """ - This function undistorts the calibration images based on the camera matrices and stores them in the project folder(defined in the config file) - to visually check if the camera matrices are correct. + This function undistorts the calibration images based on the camera matrices and stores them in the project folder(defined in the config file) + to visually check if the camera matrices are correct. Parameters ---------- @@ -294,7 +295,7 @@ def check_undistortion(config, cbrow=8, cbcol=6, plot=True): cbrow : int Int specifying the number of rows in the calibration image. - + cbcol : int Int specifying the number of columns in the calibration image. diff --git a/deeplabcut/pose_estimation_3d/plotting3D.py b/deeplabcut/pose_estimation_3d/plotting3D.py index 500496c57..20ff05381 100644 --- a/deeplabcut/pose_estimation_3d/plotting3D.py +++ b/deeplabcut/pose_estimation_3d/plotting3D.py @@ -1,12 +1,13 @@ -""" -DeepLabCut2.0 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut - -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import glob import os diff --git a/deeplabcut/pose_estimation_3d/triangulation.py b/deeplabcut/pose_estimation_3d/triangulation.py index 126fa2d46..56da86095 100644 --- a/deeplabcut/pose_estimation_3d/triangulation.py +++ b/deeplabcut/pose_estimation_3d/triangulation.py @@ -1,12 +1,13 @@ -""" -DeepLabCut2.0 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut - -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import os from pathlib import Path diff --git a/deeplabcut/pose_estimation_tensorflow/__init__.py b/deeplabcut/pose_estimation_tensorflow/__init__.py index cca4332e2..c1a7f902b 100644 --- a/deeplabcut/pose_estimation_tensorflow/__init__.py +++ b/deeplabcut/pose_estimation_tensorflow/__init__.py @@ -1,12 +1,17 @@ -""" -DeepLabCut2.0 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut -Please see AUTHORS for contributors. +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Adapted from DeeperCut by Eldar Insafutdinov +# https://github.com/eldar/pose-tensorflow +# +# Licensed under GNU Lesser General Public License v3.0 +# -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" from deeplabcut.pose_estimation_tensorflow.config import * from deeplabcut.pose_estimation_tensorflow.datasets import * diff --git a/deeplabcut/pose_estimation_tensorflow/backbones/__init__.py b/deeplabcut/pose_estimation_tensorflow/backbones/__init__.py index e69de29bb..38ef00b55 100644 --- a/deeplabcut/pose_estimation_tensorflow/backbones/__init__.py +++ b/deeplabcut/pose_estimation_tensorflow/backbones/__init__.py @@ -0,0 +1,15 @@ +# +# Copyright 2019 The TensorFlow Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/deeplabcut/pose_estimation_tensorflow/backbones/efficientnet_builder.py b/deeplabcut/pose_estimation_tensorflow/backbones/efficientnet_builder.py index 0b7d9932f..307bf4adf 100644 --- a/deeplabcut/pose_estimation_tensorflow/backbones/efficientnet_builder.py +++ b/deeplabcut/pose_estimation_tensorflow/backbones/efficientnet_builder.py @@ -1,3 +1,4 @@ +# # Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,7 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# ============================================================================== +# import functools import os import re diff --git a/deeplabcut/pose_estimation_tensorflow/backbones/efficientnet_model.py b/deeplabcut/pose_estimation_tensorflow/backbones/efficientnet_model.py index ba7a41c23..5a063d2c1 100644 --- a/deeplabcut/pose_estimation_tensorflow/backbones/efficientnet_model.py +++ b/deeplabcut/pose_estimation_tensorflow/backbones/efficientnet_model.py @@ -1,3 +1,4 @@ +# # Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,7 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# ============================================================================== +# """Contains definitions for EfficientNet model. [1] Mingxing Tan, Quoc V. Le EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks. diff --git a/deeplabcut/pose_estimation_tensorflow/backbones/mobilenet.py b/deeplabcut/pose_estimation_tensorflow/backbones/mobilenet.py index 0858b9c69..b4fe2f5e8 100644 --- a/deeplabcut/pose_estimation_tensorflow/backbones/mobilenet.py +++ b/deeplabcut/pose_estimation_tensorflow/backbones/mobilenet.py @@ -1,3 +1,4 @@ +# # Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,7 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# ============================================================================== +# import collections import contextlib import copy diff --git a/deeplabcut/pose_estimation_tensorflow/backbones/mobilenet_v2.py b/deeplabcut/pose_estimation_tensorflow/backbones/mobilenet_v2.py index 7ec8e469d..f716ed6da 100644 --- a/deeplabcut/pose_estimation_tensorflow/backbones/mobilenet_v2.py +++ b/deeplabcut/pose_estimation_tensorflow/backbones/mobilenet_v2.py @@ -1,3 +1,4 @@ +# # Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,7 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# ============================================================================== +# """Implementation of Mobilenet V2. diff --git a/deeplabcut/pose_estimation_tensorflow/config.py b/deeplabcut/pose_estimation_tensorflow/config.py index 98b688bd0..d36bf01a0 100644 --- a/deeplabcut/pose_estimation_tensorflow/config.py +++ b/deeplabcut/pose_estimation_tensorflow/config.py @@ -1,7 +1,16 @@ -""" -Adapted from DeeperCut by Eldar Insafutdinov -https://github.com/eldar/pose-tensorflow -""" +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Adapted from DeeperCut by Eldar Insafutdinov +# https://github.com/eldar/pose-tensorflow +# +# Licensed under GNU Lesser General Public License v3.0 +# import logging import pprint diff --git a/deeplabcut/pose_estimation_tensorflow/core/__init__.py b/deeplabcut/pose_estimation_tensorflow/core/__init__.py index e69de29bb..2dd1b0602 100644 --- a/deeplabcut/pose_estimation_tensorflow/core/__init__.py +++ b/deeplabcut/pose_estimation_tensorflow/core/__init__.py @@ -0,0 +1,10 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# diff --git a/deeplabcut/pose_estimation_tensorflow/core/evaluate.py b/deeplabcut/pose_estimation_tensorflow/core/evaluate.py index 383078caa..38c05892c 100644 --- a/deeplabcut/pose_estimation_tensorflow/core/evaluate.py +++ b/deeplabcut/pose_estimation_tensorflow/core/evaluate.py @@ -1,12 +1,13 @@ -""" -DeepLabCut2.0 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut - -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import argparse diff --git a/deeplabcut/pose_estimation_tensorflow/core/evaluate_multianimal.py b/deeplabcut/pose_estimation_tensorflow/core/evaluate_multianimal.py index 82203c502..fee326d7c 100644 --- a/deeplabcut/pose_estimation_tensorflow/core/evaluate_multianimal.py +++ b/deeplabcut/pose_estimation_tensorflow/core/evaluate_multianimal.py @@ -1,12 +1,13 @@ -""" -DeepLabCut 2.2 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut - -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import imgaug.augmenters as iaa import os diff --git a/deeplabcut/pose_estimation_tensorflow/core/openvino/__init__.py b/deeplabcut/pose_estimation_tensorflow/core/openvino/__init__.py index e69de29bb..2dd1b0602 100644 --- a/deeplabcut/pose_estimation_tensorflow/core/openvino/__init__.py +++ b/deeplabcut/pose_estimation_tensorflow/core/openvino/__init__.py @@ -0,0 +1,10 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# diff --git a/deeplabcut/pose_estimation_tensorflow/core/openvino/mo_extensions/__init__.py b/deeplabcut/pose_estimation_tensorflow/core/openvino/mo_extensions/__init__.py index e69de29bb..2dd1b0602 100644 --- a/deeplabcut/pose_estimation_tensorflow/core/openvino/mo_extensions/__init__.py +++ b/deeplabcut/pose_estimation_tensorflow/core/openvino/mo_extensions/__init__.py @@ -0,0 +1,10 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# diff --git a/deeplabcut/pose_estimation_tensorflow/core/openvino/mo_extensions/front/__init__.py b/deeplabcut/pose_estimation_tensorflow/core/openvino/mo_extensions/front/__init__.py index e69de29bb..2dd1b0602 100644 --- a/deeplabcut/pose_estimation_tensorflow/core/openvino/mo_extensions/front/__init__.py +++ b/deeplabcut/pose_estimation_tensorflow/core/openvino/mo_extensions/front/__init__.py @@ -0,0 +1,10 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# diff --git a/deeplabcut/pose_estimation_tensorflow/core/openvino/mo_extensions/front/tf/__init__.py b/deeplabcut/pose_estimation_tensorflow/core/openvino/mo_extensions/front/tf/__init__.py index e69de29bb..2dd1b0602 100644 --- a/deeplabcut/pose_estimation_tensorflow/core/openvino/mo_extensions/front/tf/__init__.py +++ b/deeplabcut/pose_estimation_tensorflow/core/openvino/mo_extensions/front/tf/__init__.py @@ -0,0 +1,10 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# diff --git a/deeplabcut/pose_estimation_tensorflow/core/openvino/mo_extensions/front/tf/unravel_index.py b/deeplabcut/pose_estimation_tensorflow/core/openvino/mo_extensions/front/tf/unravel_index.py index 876f3fb18..f72dd5e28 100644 --- a/deeplabcut/pose_estimation_tensorflow/core/openvino/mo_extensions/front/tf/unravel_index.py +++ b/deeplabcut/pose_estimation_tensorflow/core/openvino/mo_extensions/front/tf/unravel_index.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import numpy as np from openvino.tools.mo.front.common.replacement import FrontReplacementOp from openvino.tools.mo.graph.graph import Graph, Node diff --git a/deeplabcut/pose_estimation_tensorflow/core/openvino/session.py b/deeplabcut/pose_estimation_tensorflow/core/openvino/session.py index 1186cabd6..9feb5e104 100644 --- a/deeplabcut/pose_estimation_tensorflow/core/openvino/session.py +++ b/deeplabcut/pose_estimation_tensorflow/core/openvino/session.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import os import subprocess diff --git a/deeplabcut/pose_estimation_tensorflow/core/predict.py b/deeplabcut/pose_estimation_tensorflow/core/predict.py index c9f2fc613..252ef0aa3 100644 --- a/deeplabcut/pose_estimation_tensorflow/core/predict.py +++ b/deeplabcut/pose_estimation_tensorflow/core/predict.py @@ -1,26 +1,16 @@ -""" -DeepLabCut2.0 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut - -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 - -Adapted from DeeperCut by Eldar Insafutdinov -https://github.com/eldar/pose-tensorflow - -To do faster inference on videos (with numpy based code; introduced in Oct 2018) -"On the inference speed and video-compression robustness of DeepLabCut" -Alexander Mathis & Richard Warren -doi: https://doi.org/10.1101/457242 -See https://www.biorxiv.org/content/early/2018/10/30/457242 - -To do even faster inference on videos (with TensorFlow based code; introduced in Oct 2019) -Pretraining boosts out-of-domain robustness for pose estimation -by Alexander Mathis, Mert Yüksekgönül, Byron Rogers, Matthias Bethge, Mackenzie W. Mathis -https://arxiv.org/abs/1909.11229 -""" +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Adapted from DeeperCut by Eldar Insafutdinov +# https://github.com/eldar/pose-tensorflow +# +# Licensed under GNU Lesser General Public License v3.0 +# import numpy as np import tensorflow as tf diff --git a/deeplabcut/pose_estimation_tensorflow/core/predict_multianimal.py b/deeplabcut/pose_estimation_tensorflow/core/predict_multianimal.py index a0d03954f..45322f260 100644 --- a/deeplabcut/pose_estimation_tensorflow/core/predict_multianimal.py +++ b/deeplabcut/pose_estimation_tensorflow/core/predict_multianimal.py @@ -1,15 +1,14 @@ -""" -DeepLabCut2.2 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut - -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 - -Extract_detections with C++ code & nms adapted from DeeperCut by Eldar Insafutdinov -https://github.com/eldar/pose-tensorflow -""" +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# + import numpy as np import tensorflow as tf diff --git a/deeplabcut/pose_estimation_tensorflow/core/test.py b/deeplabcut/pose_estimation_tensorflow/core/test.py index 89bf45424..06bed0af9 100644 --- a/deeplabcut/pose_estimation_tensorflow/core/test.py +++ b/deeplabcut/pose_estimation_tensorflow/core/test.py @@ -1,7 +1,16 @@ -""" -Adapted from DeeperCut by Eldar Insafutdinov -https://github.com/eldar/pose-tensorflow -""" +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Adapted from DeeperCut by Eldar Insafutdinov +# https://github.com/eldar/pose-tensorflow +# +# Licensed under GNU Lesser General Public License v3.0 +# import argparse import logging diff --git a/deeplabcut/pose_estimation_tensorflow/core/train.py b/deeplabcut/pose_estimation_tensorflow/core/train.py index 05c77497d..3a47e3287 100644 --- a/deeplabcut/pose_estimation_tensorflow/core/train.py +++ b/deeplabcut/pose_estimation_tensorflow/core/train.py @@ -1,16 +1,17 @@ -""" -DeepLabCut2.0 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Adapted from DeeperCut by Eldar Insafutdinov +# https://github.com/eldar/pose-tensorflow +# +# Licensed under GNU Lesser General Public License v3.0 +# -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 - -Adapted from DeeperCut by Eldar Insafutdinov -https://github.com/eldar/pose-tensorflow - -""" import argparse import logging import os diff --git a/deeplabcut/pose_estimation_tensorflow/core/train_multianimal.py b/deeplabcut/pose_estimation_tensorflow/core/train_multianimal.py index 37a8ce8f1..81fc23471 100644 --- a/deeplabcut/pose_estimation_tensorflow/core/train_multianimal.py +++ b/deeplabcut/pose_estimation_tensorflow/core/train_multianimal.py @@ -1,15 +1,14 @@ -""" -DeepLabCut2.2 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut - -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 - -Adapted from DeeperCut by Eldar Insafutdinov -https://github.com/eldar/pose-tensorflow -""" +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# + import argparse import logging import os diff --git a/deeplabcut/pose_estimation_tensorflow/datasets/__init__.py b/deeplabcut/pose_estimation_tensorflow/datasets/__init__.py index 4f4916b3e..c1a58a6b2 100644 --- a/deeplabcut/pose_estimation_tensorflow/datasets/__init__.py +++ b/deeplabcut/pose_estimation_tensorflow/datasets/__init__.py @@ -1,12 +1,14 @@ -""" -DeepLabCut2.0 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut -Please see AUTHORS for contributors. +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" from .factory import PoseDatasetFactory from .pose_deterministic import DeterministicPoseDataset from .pose_scalecrop import ScalecropPoseDataset diff --git a/deeplabcut/pose_estimation_tensorflow/datasets/augmentation.py b/deeplabcut/pose_estimation_tensorflow/datasets/augmentation.py index 5bef091d3..d2046a891 100644 --- a/deeplabcut/pose_estimation_tensorflow/datasets/augmentation.py +++ b/deeplabcut/pose_estimation_tensorflow/datasets/augmentation.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import imgaug.augmenters as iaa import numpy as np from imgaug import KeypointsOnImage diff --git a/deeplabcut/pose_estimation_tensorflow/datasets/factory.py b/deeplabcut/pose_estimation_tensorflow/datasets/factory.py index 805a83a66..2415f9990 100644 --- a/deeplabcut/pose_estimation_tensorflow/datasets/factory.py +++ b/deeplabcut/pose_estimation_tensorflow/datasets/factory.py @@ -1,14 +1,17 @@ -""" -DeepLabCut2.2 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Adapted from DeeperCut by Eldar Insafutdinov +# https://github.com/eldar/pose-tensorflow +# +# Licensed under GNU Lesser General Public License v3.0 +# -Adapted from DeeperCut by Eldar Insafutdinov -https://github.com/eldar/pose-tensorflow -""" import warnings diff --git a/deeplabcut/pose_estimation_tensorflow/datasets/pose_base.py b/deeplabcut/pose_estimation_tensorflow/datasets/pose_base.py index 6e3cfb328..37b23b3a6 100644 --- a/deeplabcut/pose_estimation_tensorflow/datasets/pose_base.py +++ b/deeplabcut/pose_estimation_tensorflow/datasets/pose_base.py @@ -1,12 +1,14 @@ -""" -DeepLabCut2.2 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut - -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# + import abc diff --git a/deeplabcut/pose_estimation_tensorflow/datasets/pose_deterministic.py b/deeplabcut/pose_estimation_tensorflow/datasets/pose_deterministic.py index df0f306f3..681150e91 100644 --- a/deeplabcut/pose_estimation_tensorflow/datasets/pose_deterministic.py +++ b/deeplabcut/pose_estimation_tensorflow/datasets/pose_deterministic.py @@ -1,15 +1,13 @@ -""" -DeepLabCut2.2 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut -Please see AUTHORS for contributors. - -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 - -Adapted from DeeperCut by Eldar Insafutdinov -https://github.com/eldar/pose-tensorflow -""" +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import logging diff --git a/deeplabcut/pose_estimation_tensorflow/datasets/pose_imgaug.py b/deeplabcut/pose_estimation_tensorflow/datasets/pose_imgaug.py index 94a2a01c1..37d314662 100644 --- a/deeplabcut/pose_estimation_tensorflow/datasets/pose_imgaug.py +++ b/deeplabcut/pose_estimation_tensorflow/datasets/pose_imgaug.py @@ -1,15 +1,14 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# """ -DeepLabCut2.0 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut - -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 - -Loader structure adapted from DeeperCut by Eldar Insafutdinov -https://github.com/eldar/pose-tensorflow - Uses imgaug dataflow for flexible augmentation Largely written by Mert Yüksekgönül during the summer in the Bethge lab -- Thanks! https://imgaug.readthedocs.io/en/latest/ diff --git a/deeplabcut/pose_estimation_tensorflow/datasets/pose_multianimal_imgaug.py b/deeplabcut/pose_estimation_tensorflow/datasets/pose_multianimal_imgaug.py index 807c6e47d..d39cb1d60 100644 --- a/deeplabcut/pose_estimation_tensorflow/datasets/pose_multianimal_imgaug.py +++ b/deeplabcut/pose_estimation_tensorflow/datasets/pose_multianimal_imgaug.py @@ -1,12 +1,14 @@ -""" -DeepLabCut2.2 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut - -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# + import logging import os diff --git a/deeplabcut/pose_estimation_tensorflow/datasets/pose_scalecrop.py b/deeplabcut/pose_estimation_tensorflow/datasets/pose_scalecrop.py index a276b23ff..b17474a67 100644 --- a/deeplabcut/pose_estimation_tensorflow/datasets/pose_scalecrop.py +++ b/deeplabcut/pose_estimation_tensorflow/datasets/pose_scalecrop.py @@ -1,14 +1,14 @@ -""" -DeepLabCut2.2 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# -Adapted from DeeperCut by Eldar Insafutdinov -https://github.com/eldar/pose-tensorflow -""" from .factory import PoseDatasetFactory from .pose_deterministic import DeterministicPoseDataset diff --git a/deeplabcut/pose_estimation_tensorflow/datasets/pose_tensorpack.py b/deeplabcut/pose_estimation_tensorflow/datasets/pose_tensorpack.py index 397489b6f..f087c2f8e 100644 --- a/deeplabcut/pose_estimation_tensorflow/datasets/pose_tensorpack.py +++ b/deeplabcut/pose_estimation_tensorflow/datasets/pose_tensorpack.py @@ -1,13 +1,14 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# """ -DeepLabCut2.0 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 - -Loader structure adapted from DeeperCut by Eldar Insafutdinov -https://github.com/eldar/pose-tensorflow See pull request: https://github.com/DeepLabCut/DeepLabCut/pull/409 diff --git a/deeplabcut/pose_estimation_tensorflow/datasets/utils.py b/deeplabcut/pose_estimation_tensorflow/datasets/utils.py index 0295eb63c..ded75db5b 100644 --- a/deeplabcut/pose_estimation_tensorflow/datasets/utils.py +++ b/deeplabcut/pose_estimation_tensorflow/datasets/utils.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import numpy as np from enum import Enum diff --git a/deeplabcut/pose_estimation_tensorflow/default_config.py b/deeplabcut/pose_estimation_tensorflow/default_config.py index 776cf16e8..9f1c8cdbc 100644 --- a/deeplabcut/pose_estimation_tensorflow/default_config.py +++ b/deeplabcut/pose_estimation_tensorflow/default_config.py @@ -1,15 +1,16 @@ -""" -DeepLabCut2.0 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut - -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 - -Adapted from DeeperCut by Eldar Insafutdinov -https://github.com/eldar/pose-tensorflow -""" +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Adapted from DeeperCut by Eldar Insafutdinov +# https://github.com/eldar/pose-tensorflow +# +# Licensed under GNU Lesser General Public License v3.0 +# cfg = dict() diff --git a/deeplabcut/pose_estimation_tensorflow/export.py b/deeplabcut/pose_estimation_tensorflow/export.py index c6cfb3d48..2d18119bb 100644 --- a/deeplabcut/pose_estimation_tensorflow/export.py +++ b/deeplabcut/pose_estimation_tensorflow/export.py @@ -1,12 +1,13 @@ -""" -DeepLabCut2.0 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut - -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import glob import os diff --git a/deeplabcut/pose_estimation_tensorflow/lib/__init__.py b/deeplabcut/pose_estimation_tensorflow/lib/__init__.py index 79125db2f..6b45344c4 100644 --- a/deeplabcut/pose_estimation_tensorflow/lib/__init__.py +++ b/deeplabcut/pose_estimation_tensorflow/lib/__init__.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# """ DeepLabCut2.0 Toolbox (deeplabcut.org) © A. & M. Mathis Labs diff --git a/deeplabcut/pose_estimation_tensorflow/lib/crossvalutils.py b/deeplabcut/pose_estimation_tensorflow/lib/crossvalutils.py index bfeb20d6d..bdf61098f 100644 --- a/deeplabcut/pose_estimation_tensorflow/lib/crossvalutils.py +++ b/deeplabcut/pose_estimation_tensorflow/lib/crossvalutils.py @@ -1,12 +1,14 @@ -""" -DeepLabCut2.2 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut - -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# + import os import pickle diff --git a/deeplabcut/pose_estimation_tensorflow/lib/inferenceutils.py b/deeplabcut/pose_estimation_tensorflow/lib/inferenceutils.py index b8e83b6e6..5f5cac868 100644 --- a/deeplabcut/pose_estimation_tensorflow/lib/inferenceutils.py +++ b/deeplabcut/pose_estimation_tensorflow/lib/inferenceutils.py @@ -1,12 +1,14 @@ -""" -DeepLabCut2.2 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut - -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# + import heapq import itertools import multiprocessing diff --git a/deeplabcut/pose_estimation_tensorflow/lib/trackingutils.py b/deeplabcut/pose_estimation_tensorflow/lib/trackingutils.py index f1d695c5d..58ae597b8 100644 --- a/deeplabcut/pose_estimation_tensorflow/lib/trackingutils.py +++ b/deeplabcut/pose_estimation_tensorflow/lib/trackingutils.py @@ -1,12 +1,14 @@ -""" -DeepLabCut2.2 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut - -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# + import abc import math import numpy as np diff --git a/deeplabcut/pose_estimation_tensorflow/models/__init__.py b/deeplabcut/pose_estimation_tensorflow/models/__init__.py index e69de29bb..2dd1b0602 100644 --- a/deeplabcut/pose_estimation_tensorflow/models/__init__.py +++ b/deeplabcut/pose_estimation_tensorflow/models/__init__.py @@ -0,0 +1,10 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# diff --git a/deeplabcut/pose_estimation_tensorflow/models/pretrained/__init__.py b/deeplabcut/pose_estimation_tensorflow/models/pretrained/__init__.py index e69de29bb..2dd1b0602 100644 --- a/deeplabcut/pose_estimation_tensorflow/models/pretrained/__init__.py +++ b/deeplabcut/pose_estimation_tensorflow/models/pretrained/__init__.py @@ -0,0 +1,10 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# diff --git a/deeplabcut/pose_estimation_tensorflow/nnets/__init__.py b/deeplabcut/pose_estimation_tensorflow/nnets/__init__.py index cd2450611..6cd0a13cb 100644 --- a/deeplabcut/pose_estimation_tensorflow/nnets/__init__.py +++ b/deeplabcut/pose_estimation_tensorflow/nnets/__init__.py @@ -1,16 +1,14 @@ -""" -DeepLabCut2.0 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut -Please see AUTHORS for contributors. +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 - -pose_estimation_tensorflow is based of Eldar's repository: -https://github.com/eldar/pose-tensorflow - -""" from .factory import PoseNetFactory from .efficientnet import PoseEfficientNet from .mobilenet import PoseMobileNet diff --git a/deeplabcut/pose_estimation_tensorflow/nnets/base.py b/deeplabcut/pose_estimation_tensorflow/nnets/base.py index ca2ebae8b..34a197c87 100644 --- a/deeplabcut/pose_estimation_tensorflow/nnets/base.py +++ b/deeplabcut/pose_estimation_tensorflow/nnets/base.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import abc import tensorflow as tf from deeplabcut.pose_estimation_tensorflow.datasets import Batch diff --git a/deeplabcut/pose_estimation_tensorflow/nnets/conv_blocks.py b/deeplabcut/pose_estimation_tensorflow/nnets/conv_blocks.py index e6d372955..3f4278400 100644 --- a/deeplabcut/pose_estimation_tensorflow/nnets/conv_blocks.py +++ b/deeplabcut/pose_estimation_tensorflow/nnets/conv_blocks.py @@ -1,3 +1,4 @@ +# # Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,7 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# ============================================================================== +# """Convolution blocks for mobilenet.""" import contextlib import functools diff --git a/deeplabcut/pose_estimation_tensorflow/nnets/efficientnet.py b/deeplabcut/pose_estimation_tensorflow/nnets/efficientnet.py index 5d4041348..0c41b147c 100644 --- a/deeplabcut/pose_estimation_tensorflow/nnets/efficientnet.py +++ b/deeplabcut/pose_estimation_tensorflow/nnets/efficientnet.py @@ -1,14 +1,14 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# """ -DeepLabCut 2.1.9 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut - -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 - -Adopted from DeeperCut by Eldar Insafutdinov -https://github.com/eldar/pose-tensorflow Effnet added by T. Biasi & AM Efficient Nets added by T. Biasi & AM diff --git a/deeplabcut/pose_estimation_tensorflow/nnets/factory.py b/deeplabcut/pose_estimation_tensorflow/nnets/factory.py index 4cd9f4be1..cbfe98ab7 100644 --- a/deeplabcut/pose_estimation_tensorflow/nnets/factory.py +++ b/deeplabcut/pose_estimation_tensorflow/nnets/factory.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import warnings diff --git a/deeplabcut/pose_estimation_tensorflow/nnets/layers.py b/deeplabcut/pose_estimation_tensorflow/nnets/layers.py index feff5544a..96b516758 100644 --- a/deeplabcut/pose_estimation_tensorflow/nnets/layers.py +++ b/deeplabcut/pose_estimation_tensorflow/nnets/layers.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import tensorflow as tf import tf_slim as slim diff --git a/deeplabcut/pose_estimation_tensorflow/nnets/mobilenet.py b/deeplabcut/pose_estimation_tensorflow/nnets/mobilenet.py index 4223b08a5..b2852d8f3 100644 --- a/deeplabcut/pose_estimation_tensorflow/nnets/mobilenet.py +++ b/deeplabcut/pose_estimation_tensorflow/nnets/mobilenet.py @@ -1,12 +1,15 @@ -""" -DeepLabCut2.2 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut -Please see AUTHORS for contributors. - -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# +""" Also see our paper: Pretraining boosts out-of-domain robustness for pose estimation by Alexander Mathis, Mert Yüksekgönül, Byron Rogers, Matthias Bethge, Mackenzie W. Mathis diff --git a/deeplabcut/pose_estimation_tensorflow/nnets/multi.py b/deeplabcut/pose_estimation_tensorflow/nnets/multi.py index f6558d45d..3909ed4cc 100644 --- a/deeplabcut/pose_estimation_tensorflow/nnets/multi.py +++ b/deeplabcut/pose_estimation_tensorflow/nnets/multi.py @@ -1,15 +1,13 @@ -""" -DeepLabCut2.2 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut - -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 - -Adapted from DeeperCut by Eldar Insafutdinov -https://github.com/eldar/pose-tensorflow -""" +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import re import tensorflow as tf diff --git a/deeplabcut/pose_estimation_tensorflow/nnets/resnet.py b/deeplabcut/pose_estimation_tensorflow/nnets/resnet.py index 51b69b4ed..07ebe8b67 100644 --- a/deeplabcut/pose_estimation_tensorflow/nnets/resnet.py +++ b/deeplabcut/pose_estimation_tensorflow/nnets/resnet.py @@ -1,15 +1,17 @@ -""" -DeepLabCut2.2 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Adapted from DeeperCut by Eldar Insafutdinov +# https://github.com/eldar/pose-tensorflow +# +# Licensed under GNU Lesser General Public License v3.0 +# -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 - -Adapted from DeeperCut by Eldar Insafutdinov -https://github.com/eldar/pose-tensorflow -""" import re import tensorflow as tf import tf_slim as slim diff --git a/deeplabcut/pose_estimation_tensorflow/nnets/utils.py b/deeplabcut/pose_estimation_tensorflow/nnets/utils.py index b54cbfc02..8afd4c455 100644 --- a/deeplabcut/pose_estimation_tensorflow/nnets/utils.py +++ b/deeplabcut/pose_estimation_tensorflow/nnets/utils.py @@ -1,3 +1,4 @@ +# # Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,7 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# ============================================================================== +# import functools import numpy as np diff --git a/deeplabcut/pose_estimation_tensorflow/predict_multianimal.py b/deeplabcut/pose_estimation_tensorflow/predict_multianimal.py index 4867c9c0d..76c388d41 100644 --- a/deeplabcut/pose_estimation_tensorflow/predict_multianimal.py +++ b/deeplabcut/pose_estimation_tensorflow/predict_multianimal.py @@ -1,12 +1,14 @@ -""" -DeepLabCut2.0 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut - -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# + import os import pickle import shelve diff --git a/deeplabcut/pose_estimation_tensorflow/predict_videos.py b/deeplabcut/pose_estimation_tensorflow/predict_videos.py index 7eafd9bbe..f603aff6b 100644 --- a/deeplabcut/pose_estimation_tensorflow/predict_videos.py +++ b/deeplabcut/pose_estimation_tensorflow/predict_videos.py @@ -1,12 +1,14 @@ -""" -DeepLabCut2.0 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut - -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# + #################################################### # Dependencies diff --git a/deeplabcut/pose_estimation_tensorflow/training.py b/deeplabcut/pose_estimation_tensorflow/training.py index be7b6d527..b3830c751 100644 --- a/deeplabcut/pose_estimation_tensorflow/training.py +++ b/deeplabcut/pose_estimation_tensorflow/training.py @@ -1,12 +1,14 @@ -""" -DeepLabCut2.0 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut - -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# + import os from pathlib import Path diff --git a/deeplabcut/pose_estimation_tensorflow/util/__init__.py b/deeplabcut/pose_estimation_tensorflow/util/__init__.py index f9b7f5849..a9b1d07db 100644 --- a/deeplabcut/pose_estimation_tensorflow/util/__init__.py +++ b/deeplabcut/pose_estimation_tensorflow/util/__init__.py @@ -1,3 +1,16 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Adapted from DeeperCut by Eldar Insafutdinov +# https://github.com/eldar/pose-tensorflow +# +# Licensed under GNU Lesser General Public License v3.0 +# """ Adapted from DeeperCut by Eldar Insafutdinov: https://github.com/eldar/pose-tensorflow diff --git a/deeplabcut/pose_estimation_tensorflow/util/logging.py b/deeplabcut/pose_estimation_tensorflow/util/logging.py index 238c20981..dc355b555 100644 --- a/deeplabcut/pose_estimation_tensorflow/util/logging.py +++ b/deeplabcut/pose_estimation_tensorflow/util/logging.py @@ -1,3 +1,16 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Adapted from DeeperCut by Eldar Insafutdinov +# https://github.com/eldar/pose-tensorflow +# +# Licensed under GNU Lesser General Public License v3.0 +# """ Adapted from DeeperCut by Eldar Insafutdinov https://github.com/eldar/pose-tensorflow diff --git a/deeplabcut/pose_estimation_tensorflow/util/visualize.py b/deeplabcut/pose_estimation_tensorflow/util/visualize.py index e660ac2eb..36ccf84f7 100644 --- a/deeplabcut/pose_estimation_tensorflow/util/visualize.py +++ b/deeplabcut/pose_estimation_tensorflow/util/visualize.py @@ -1,3 +1,16 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Adapted from DeeperCut by Eldar Insafutdinov +# https://github.com/eldar/pose-tensorflow +# +# Licensed under GNU Lesser General Public License v3.0 +# """ Adapted from DeeperCut by Eldar Insafutdinov https://github.com/eldar/pose-tensorflow diff --git a/deeplabcut/pose_estimation_tensorflow/vis_dataset.py b/deeplabcut/pose_estimation_tensorflow/vis_dataset.py index df5332f87..087da104b 100644 --- a/deeplabcut/pose_estimation_tensorflow/vis_dataset.py +++ b/deeplabcut/pose_estimation_tensorflow/vis_dataset.py @@ -1,7 +1,17 @@ -""" -Adapted from DeeperCut by Eldar Insafutdinov -https://github.com/eldar/pose-tensorflow -""" +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Adapted from DeeperCut by Eldar Insafutdinov +# https://github.com/eldar/pose-tensorflow +# +# Licensed under GNU Lesser General Public License v3.0 +# + import logging diff --git a/deeplabcut/pose_estimation_tensorflow/visualizemaps.py b/deeplabcut/pose_estimation_tensorflow/visualizemaps.py index 582d9ba0f..202adc1e9 100644 --- a/deeplabcut/pose_estimation_tensorflow/visualizemaps.py +++ b/deeplabcut/pose_estimation_tensorflow/visualizemaps.py @@ -1,12 +1,14 @@ -""" -DeepLabCut2.0 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut - -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# + import os import matplotlib.pyplot as plt diff --git a/deeplabcut/pose_tracking_pytorch/__init__.py b/deeplabcut/pose_tracking_pytorch/__init__.py index 6c13fe16d..54b4f0d0e 100644 --- a/deeplabcut/pose_tracking_pytorch/__init__.py +++ b/deeplabcut/pose_tracking_pytorch/__init__.py @@ -1,12 +1,14 @@ -""" -DeepLabCut2.2 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" from .create_dataset import * from .tracking_utils.preprocessing import * from .train_dlctransreid import train_tracking_transformer diff --git a/deeplabcut/pose_tracking_pytorch/apis.py b/deeplabcut/pose_tracking_pytorch/apis.py index 51d7d8f00..10f9c752b 100644 --- a/deeplabcut/pose_tracking_pytorch/apis.py +++ b/deeplabcut/pose_tracking_pytorch/apis.py @@ -1,12 +1,13 @@ -""" -DeepLabCut2.2 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut - -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# def transformer_reID( diff --git a/deeplabcut/pose_tracking_pytorch/config/__init__.py b/deeplabcut/pose_tracking_pytorch/config/__init__.py index b8310bdfb..fcd59e9fc 100644 --- a/deeplabcut/pose_tracking_pytorch/config/__init__.py +++ b/deeplabcut/pose_tracking_pytorch/config/__init__.py @@ -1,12 +1,14 @@ -""" -DeepLabCut2.2 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" import os from deeplabcut.utils.auxiliaryfunctions import ( read_plainconfig, diff --git a/deeplabcut/pose_tracking_pytorch/create_dataset.py b/deeplabcut/pose_tracking_pytorch/create_dataset.py index 899a5d2b7..02c065746 100644 --- a/deeplabcut/pose_tracking_pytorch/create_dataset.py +++ b/deeplabcut/pose_tracking_pytorch/create_dataset.py @@ -1,12 +1,14 @@ -""" -DeepLabCut2.2 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut - -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# + import numpy as np import os import pickle @@ -42,15 +44,15 @@ def save_train_triplets(feature_fname, triplets, out_name): anchor_coord, anchor_frame = anchor pos_coord, pos_frame = pos neg_coord, neg_frame = neg - - + + anchor_frame = "frame" + str(anchor_frame).zfill(zfill_width) pos_frame = "frame" + str(pos_frame).zfill(zfill_width) neg_frame = "frame" + str(neg_frame).zfill(zfill_width) if anchor_frame in feature_dict and pos_frame in feature_dict and neg_frame in feature_dict: # only try to find these features if they are in the dictionary - + anchor_vec = query_feature_by_coord_in_img_space( feature_dict, anchor_frame, anchor_coord ) diff --git a/deeplabcut/pose_tracking_pytorch/datasets/__init__.py b/deeplabcut/pose_tracking_pytorch/datasets/__init__.py index 23a7c818c..e367a92c1 100644 --- a/deeplabcut/pose_tracking_pytorch/datasets/__init__.py +++ b/deeplabcut/pose_tracking_pytorch/datasets/__init__.py @@ -1,10 +1,12 @@ -""" -DeepLabCut2.2 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" from .make_dataloader import make_dlc_dataloader diff --git a/deeplabcut/pose_tracking_pytorch/datasets/dlc_vec.py b/deeplabcut/pose_tracking_pytorch/datasets/dlc_vec.py index b372d0dfd..640ebb28d 100644 --- a/deeplabcut/pose_tracking_pytorch/datasets/dlc_vec.py +++ b/deeplabcut/pose_tracking_pytorch/datasets/dlc_vec.py @@ -1,12 +1,14 @@ -""" -DeepLabCut2.2 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut - -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# + from torch.utils.data import Dataset import numpy as np diff --git a/deeplabcut/pose_tracking_pytorch/datasets/make_dataloader.py b/deeplabcut/pose_tracking_pytorch/datasets/make_dataloader.py index b7c432c5d..e96c9fa48 100644 --- a/deeplabcut/pose_tracking_pytorch/datasets/make_dataloader.py +++ b/deeplabcut/pose_tracking_pytorch/datasets/make_dataloader.py @@ -1,12 +1,14 @@ -""" -DeepLabCut2.2 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" from torch.utils.data import DataLoader from .dlc_vec import TripletDataset diff --git a/deeplabcut/pose_tracking_pytorch/inference.py b/deeplabcut/pose_tracking_pytorch/inference.py index 529bb7861..e9973f3ce 100644 --- a/deeplabcut/pose_tracking_pytorch/inference.py +++ b/deeplabcut/pose_tracking_pytorch/inference.py @@ -1,12 +1,14 @@ -""" -DeepLabCut2.2 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut - -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# + import torch import torch.nn as nn import numpy as np diff --git a/deeplabcut/pose_tracking_pytorch/loss/__init__.py b/deeplabcut/pose_tracking_pytorch/loss/__init__.py index 181528fdd..71a92651b 100644 --- a/deeplabcut/pose_tracking_pytorch/loss/__init__.py +++ b/deeplabcut/pose_tracking_pytorch/loss/__init__.py @@ -1 +1,11 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# from .make_loss import easy_triplet_loss diff --git a/deeplabcut/pose_tracking_pytorch/loss/make_loss.py b/deeplabcut/pose_tracking_pytorch/loss/make_loss.py index d21a1b88f..546ad68ab 100644 --- a/deeplabcut/pose_tracking_pytorch/loss/make_loss.py +++ b/deeplabcut/pose_tracking_pytorch/loss/make_loss.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import torch diff --git a/deeplabcut/pose_tracking_pytorch/model/__init__.py b/deeplabcut/pose_tracking_pytorch/model/__init__.py index 761344cf0..cd526a115 100644 --- a/deeplabcut/pose_tracking_pytorch/model/__init__.py +++ b/deeplabcut/pose_tracking_pytorch/model/__init__.py @@ -1,10 +1,12 @@ -""" -DeepLabCut2.2 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" from .make_model import make_dlc_model, build_dlc_transformer diff --git a/deeplabcut/pose_tracking_pytorch/model/backbones/__init__.py b/deeplabcut/pose_tracking_pytorch/model/backbones/__init__.py index fba7515bc..3c3f8f348 100644 --- a/deeplabcut/pose_tracking_pytorch/model/backbones/__init__.py +++ b/deeplabcut/pose_tracking_pytorch/model/backbones/__init__.py @@ -1 +1,11 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# from .vit_pytorch import dlc_base_kpt_TransReID diff --git a/deeplabcut/pose_tracking_pytorch/model/make_model.py b/deeplabcut/pose_tracking_pytorch/model/make_model.py index 4da95bf1a..5c218ea5e 100644 --- a/deeplabcut/pose_tracking_pytorch/model/make_model.py +++ b/deeplabcut/pose_tracking_pytorch/model/make_model.py @@ -1,12 +1,14 @@ -""" -DeepLabCut2.2 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut - -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# + import torch import torch.nn as nn from .backbones.vit_pytorch import dlc_base_kpt_TransReID diff --git a/deeplabcut/pose_tracking_pytorch/processor/__init__.py b/deeplabcut/pose_tracking_pytorch/processor/__init__.py index 0228e939c..ca4458ac7 100644 --- a/deeplabcut/pose_tracking_pytorch/processor/__init__.py +++ b/deeplabcut/pose_tracking_pytorch/processor/__init__.py @@ -1,10 +1,12 @@ -""" -DeepLabCut2.2 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" from .processor import do_dlc_train, do_dlc_inference, do_dlc_pair_inference, default_device diff --git a/deeplabcut/pose_tracking_pytorch/processor/processor.py b/deeplabcut/pose_tracking_pytorch/processor/processor.py index 3c56865ff..7abc27051 100644 --- a/deeplabcut/pose_tracking_pytorch/processor/processor.py +++ b/deeplabcut/pose_tracking_pytorch/processor/processor.py @@ -1,12 +1,14 @@ -""" -DeepLabCut2.2 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut - -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# + import logging import os import time diff --git a/deeplabcut/pose_tracking_pytorch/solver/__init__.py b/deeplabcut/pose_tracking_pytorch/solver/__init__.py index 920843dd0..7175205e4 100644 --- a/deeplabcut/pose_tracking_pytorch/solver/__init__.py +++ b/deeplabcut/pose_tracking_pytorch/solver/__init__.py @@ -1 +1,11 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# from .make_optimizer import make_easy_optimizer diff --git a/deeplabcut/pose_tracking_pytorch/solver/cosine_lr.py b/deeplabcut/pose_tracking_pytorch/solver/cosine_lr.py index 4173bd958..7e7aeba85 100644 --- a/deeplabcut/pose_tracking_pytorch/solver/cosine_lr.py +++ b/deeplabcut/pose_tracking_pytorch/solver/cosine_lr.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# """ Cosine Scheduler Cosine LR schedule with warmup, cycle/restarts, noise. diff --git a/deeplabcut/pose_tracking_pytorch/solver/make_optimizer.py b/deeplabcut/pose_tracking_pytorch/solver/make_optimizer.py index 76e277703..e0582b395 100644 --- a/deeplabcut/pose_tracking_pytorch/solver/make_optimizer.py +++ b/deeplabcut/pose_tracking_pytorch/solver/make_optimizer.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import torch diff --git a/deeplabcut/pose_tracking_pytorch/solver/scheduler.py b/deeplabcut/pose_tracking_pytorch/solver/scheduler.py index 5b690905f..699f882b8 100644 --- a/deeplabcut/pose_tracking_pytorch/solver/scheduler.py +++ b/deeplabcut/pose_tracking_pytorch/solver/scheduler.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# from typing import Dict, Any import torch diff --git a/deeplabcut/pose_tracking_pytorch/solver/scheduler_factory.py b/deeplabcut/pose_tracking_pytorch/solver/scheduler_factory.py index 2d485faa7..fcbd8270a 100644 --- a/deeplabcut/pose_tracking_pytorch/solver/scheduler_factory.py +++ b/deeplabcut/pose_tracking_pytorch/solver/scheduler_factory.py @@ -1,3 +1,21 @@ +# +# Copyright 2019 Ross Wightman +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Hacked together by / Copyright 2020 Ross Wightman +# https://github.com/rwightman/pytorch-image-models/blob/main/timm/scheduler/scheduler_factory.py +# """ Scheduler Factory Hacked together by / Copyright 2020 Ross Wightman """ diff --git a/deeplabcut/pose_tracking_pytorch/tracking_utils/__init__.py b/deeplabcut/pose_tracking_pytorch/tracking_utils/__init__.py index e43d38414..d3a9fbccb 100644 --- a/deeplabcut/pose_tracking_pytorch/tracking_utils/__init__.py +++ b/deeplabcut/pose_tracking_pytorch/tracking_utils/__init__.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# from .preprocessing import ( load_features_from_coord, convert_coord_from_img_space_to_feature_space, diff --git a/deeplabcut/pose_tracking_pytorch/tracking_utils/meter.py b/deeplabcut/pose_tracking_pytorch/tracking_utils/meter.py index b72370ea8..c26c07655 100644 --- a/deeplabcut/pose_tracking_pytorch/tracking_utils/meter.py +++ b/deeplabcut/pose_tracking_pytorch/tracking_utils/meter.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# class AverageMeter(object): """Computes and stores the average and current value""" diff --git a/deeplabcut/pose_tracking_pytorch/tracking_utils/metrics.py b/deeplabcut/pose_tracking_pytorch/tracking_utils/metrics.py index 8d47b3496..cc153b2e8 100644 --- a/deeplabcut/pose_tracking_pytorch/tracking_utils/metrics.py +++ b/deeplabcut/pose_tracking_pytorch/tracking_utils/metrics.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import torch import numpy as np from ..tracking_utils.reranking import re_ranking diff --git a/deeplabcut/pose_tracking_pytorch/tracking_utils/preprocessing.py b/deeplabcut/pose_tracking_pytorch/tracking_utils/preprocessing.py index 42460af2e..7e59d2c21 100644 --- a/deeplabcut/pose_tracking_pytorch/tracking_utils/preprocessing.py +++ b/deeplabcut/pose_tracking_pytorch/tracking_utils/preprocessing.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import numpy as np diff --git a/deeplabcut/pose_tracking_pytorch/tracking_utils/reranking.py b/deeplabcut/pose_tracking_pytorch/tracking_utils/reranking.py index 2184c756a..1c41e5e8d 100644 --- a/deeplabcut/pose_tracking_pytorch/tracking_utils/reranking.py +++ b/deeplabcut/pose_tracking_pytorch/tracking_utils/reranking.py @@ -1,18 +1,8 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -""" -Created on Fri, 25 May 2018 20:29:09 - - -""" - """ CVPR2017 paper:Zhong Z, Zheng L, Cao D, et al. Re-ranking Person Re-identification with k-reciprocal Encoding[J]. 2017. url:http://openaccess.thecvf.com/content_cvpr_2017/papers/Zhong_Re-Ranking_Person_Re-Identification_CVPR_2017_paper.pdf Matlab version: https://github.com/zhunzhong07/person-re-ranking -""" -""" API probFea: all feature vectors of the query set (torch tensor) diff --git a/deeplabcut/pose_tracking_pytorch/train_dlctransreid.py b/deeplabcut/pose_tracking_pytorch/train_dlctransreid.py index 918ee4ec9..c17adecaf 100644 --- a/deeplabcut/pose_tracking_pytorch/train_dlctransreid.py +++ b/deeplabcut/pose_tracking_pytorch/train_dlctransreid.py @@ -1,12 +1,14 @@ -""" -DeepLabCut2.2 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut - -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# + import random try: import torch diff --git a/deeplabcut/post_processing/__init__.py b/deeplabcut/post_processing/__init__.py index a137a2ad2..56ad1689f 100644 --- a/deeplabcut/post_processing/__init__.py +++ b/deeplabcut/post_processing/__init__.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# """ DeepLabCut2.0 Toolbox (deeplabcut.org) © A. & M. Mathis Labs diff --git a/deeplabcut/post_processing/analyze_skeleton.py b/deeplabcut/post_processing/analyze_skeleton.py index f483e6e04..d30587c30 100644 --- a/deeplabcut/post_processing/analyze_skeleton.py +++ b/deeplabcut/post_processing/analyze_skeleton.py @@ -1,13 +1,16 @@ -""" -DeepLabCut2.0 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut -Please see AUTHORS for contributors. - -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# -Written by Federico Claudi - https://github.com/FedeClaudi +""" +Contributed by Federico Claudi - https://github.com/FedeClaudi """ import argparse diff --git a/deeplabcut/post_processing/filtering.py b/deeplabcut/post_processing/filtering.py index 4a043cd25..1c81081b6 100644 --- a/deeplabcut/post_processing/filtering.py +++ b/deeplabcut/post_processing/filtering.py @@ -1,12 +1,14 @@ -""" -DeepLabCut2.0 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut -Please see AUTHORS for contributors. - -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# + import argparse from pathlib import Path diff --git a/deeplabcut/refine_training_dataset/__init__.py b/deeplabcut/refine_training_dataset/__init__.py index ca013626e..6c04417f9 100644 --- a/deeplabcut/refine_training_dataset/__init__.py +++ b/deeplabcut/refine_training_dataset/__init__.py @@ -1,12 +1,13 @@ -""" -DeepLabCut2.0 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut -Please see AUTHORS for contributors. - -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# from deeplabcut.refine_training_dataset.tracklets import * diff --git a/deeplabcut/refine_training_dataset/outlier_frames.py b/deeplabcut/refine_training_dataset/outlier_frames.py index 56dbee8c6..2001d24ee 100644 --- a/deeplabcut/refine_training_dataset/outlier_frames.py +++ b/deeplabcut/refine_training_dataset/outlier_frames.py @@ -1,12 +1,14 @@ -""" -DeepLabCut2.0 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut -Please see AUTHORS for contributors. - -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# + import argparse import os diff --git a/deeplabcut/refine_training_dataset/stitch.py b/deeplabcut/refine_training_dataset/stitch.py index 0694aeb42..f94bc88a0 100644 --- a/deeplabcut/refine_training_dataset/stitch.py +++ b/deeplabcut/refine_training_dataset/stitch.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import matplotlib.pyplot as plt import networkx as nx import numpy as np diff --git a/deeplabcut/refine_training_dataset/tracklets.py b/deeplabcut/refine_training_dataset/tracklets.py index fa5ce015e..bbdc0de60 100644 --- a/deeplabcut/refine_training_dataset/tracklets.py +++ b/deeplabcut/refine_training_dataset/tracklets.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import numpy as np import pandas as pd import pickle diff --git a/deeplabcut/utils/__init__.py b/deeplabcut/utils/__init__.py index 44202a1c3..f26cb4708 100644 --- a/deeplabcut/utils/__init__.py +++ b/deeplabcut/utils/__init__.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# from deeplabcut.utils.auxfun_multianimal import * from deeplabcut.utils.auxfun_videos import * from deeplabcut.utils.auxiliaryfunctions import * diff --git a/deeplabcut/utils/auxfun_models.py b/deeplabcut/utils/auxfun_models.py index edc3dbb36..17a0e24d0 100644 --- a/deeplabcut/utils/auxfun_models.py +++ b/deeplabcut/utils/auxfun_models.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# """ DeepLabCut2.0 Toolbox (deeplabcut.org) © A. & M. Mathis Labs @@ -144,92 +154,6 @@ def tarfilenamecutting(tarf): print("Model does not exist: ", modelname) print("Pick one of the following: ", models) -def download_hugginface_model(modelname, target_dir): - """ - Downloads a DeepLabCut Model Zoo Project from Hugging Face - """ - import tarfile - from huggingface_hub import hf_hub_download - - def tarfilenamecutting(tarf): - """' auxfun to extract folder path - ie. /xyz-trainsetxyshufflez/ - """ - for memberid, member in enumerate(tarf.getmembers()): - if memberid == 0: - parent = str(member.path) - l = len(parent) + 1 - if member.path.startswith(parent): - member.path = member.path[l:] - yield member - - # Loading urls of models - dlc_path = auxiliaryfunctions.get_deeplabcut_path() - neturls = auxiliaryfunctions.read_plainconfig( - os.path.join( - dlc_path, - "pose_estimation_tensorflow", - "models", - "pretrained", - "pretrained_model_urls.yaml", - ) - ) - url = neturls[modelname] - - if modelname in neturls.keys(): - print("Loading....", modelname) - url = neturls[modelname].split('/') - repo_id,targzfn=url[0]+'/'+url[1],str(url[-1]) - - hf_hub_download(repo_id,targzfn,cache_dir = str(target_dir)) - #creates a new subfolder as indicated below, unzipping from there and deleting this folder - - # Hack to get hf path ... - hf_folder = 'models--'+url[0]+'--'+url[1] - filename = os.path.join( - target_dir, hf_folder, "snapshots", str(neturls[modelname+"_commit"]), targzfn, - ) - with tarfile.open(filename, mode="r:gz") as tar: - tar.extractall(target_dir, members=tarfilenamecutting(tar)) - - # Move the weights to target_dir and clean the remaining temporary folders - import shutil - weights_folder = os.path.join(target_dir, targzfn.replace(".tar.gz", "")) - shutil.copytree(weights_folder, target_dir, dirs_exist_ok=True) - shutil.rmtree(os.path.join(target_dir, hf_folder)) - shutil.rmtree(weights_folder) - - else: - models = [ - fn - for fn in neturls.keys() - if "resnet_" not in fn and "efficientnet" not in fn and "mobilenet_" not in fn - ] - print("Model does not exist: ", modelname) - print("Pick one of the following: ", models) - -def download_mpii_weights(wd): - """ Downloads weights pretrained on human data from DeeperCut. """ - import urllib.request - from pathlib import Path - - url = [ - "https://datasets.d2.mpi-inf.mpg.de/deepercut-models-tensorflow/mpii-single-resnet-101.data-00000-of-00001", - "https://datasets.d2.mpi-inf.mpg.de/deepercut-models-tensorflow/mpii-single-resnet-101.meta", - "https://datasets.d2.mpi-inf.mpg.de/deepercut-models-tensorflow/mpii-single-resnet-101.index", - ] - for i in url: - file = str(Path(i).name) - filename = file.replace("mpii-single-resnet-101", "snapshot-103000") - filename = os.path.join(wd, filename) - if os.path.isfile(filename): - print("Weights already present!") - break # not checking all the 3 files. - else: - urllib.request.urlretrieve(i, filename) - - return filename - # Aliases for backwards-compatibility Check4Weights = check_for_weights diff --git a/deeplabcut/utils/auxfun_multianimal.py b/deeplabcut/utils/auxfun_multianimal.py index c2fc409c4..b4c500aa8 100644 --- a/deeplabcut/utils/auxfun_multianimal.py +++ b/deeplabcut/utils/auxfun_multianimal.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# """ DeepLabCut2.0 Toolbox (deeplabcut.org) © A. & M. Mathis Labs diff --git a/deeplabcut/utils/auxfun_videos.py b/deeplabcut/utils/auxfun_videos.py index 2918195ad..b66832468 100644 --- a/deeplabcut/utils/auxfun_videos.py +++ b/deeplabcut/utils/auxfun_videos.py @@ -1,4 +1,14 @@ #!/usr/bin/env python3 +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# """ DeepLabCut2.0 Toolbox (deeplabcut.org) © A. & M. Mathis Labs diff --git a/deeplabcut/utils/auxiliaryfunctions.py b/deeplabcut/utils/auxiliaryfunctions.py index 6a8cf5716..5051755b7 100644 --- a/deeplabcut/utils/auxiliaryfunctions.py +++ b/deeplabcut/utils/auxiliaryfunctions.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# """ DeepLabCut2.0 Toolbox (deeplabcut.org) © A. & M. Mathis Labs diff --git a/deeplabcut/utils/auxiliaryfunctions_3d.py b/deeplabcut/utils/auxiliaryfunctions_3d.py index 1fe857e4b..b97b52bd4 100644 --- a/deeplabcut/utils/auxiliaryfunctions_3d.py +++ b/deeplabcut/utils/auxiliaryfunctions_3d.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# """ DeepLabCut2.0 Toolbox (deeplabcut.org) © A. & M. Mathis Labs diff --git a/deeplabcut/utils/conversioncode.py b/deeplabcut/utils/conversioncode.py index 3a6421cfd..9a0b746a5 100644 --- a/deeplabcut/utils/conversioncode.py +++ b/deeplabcut/utils/conversioncode.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# """ DeepLabCut2.0 Toolbox (deeplabcut.org) © A. & M. Mathis Labs diff --git a/deeplabcut/utils/frameselectiontools.py b/deeplabcut/utils/frameselectiontools.py index 92cd2b097..e09cc3642 100644 --- a/deeplabcut/utils/frameselectiontools.py +++ b/deeplabcut/utils/frameselectiontools.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# """ DeepLabCut2.0 Toolbox (deeplabcut.org) © A. & M. Mathis Labs diff --git a/deeplabcut/utils/make_labeled_video.py b/deeplabcut/utils/make_labeled_video.py index bb8121b0e..1287c6340 100644 --- a/deeplabcut/utils/make_labeled_video.py +++ b/deeplabcut/utils/make_labeled_video.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# """ DeepLabCut2.0 Toolbox (deeplabcut.org) © A. & M. Mathis Labs diff --git a/deeplabcut/utils/plotting.py b/deeplabcut/utils/plotting.py index 716eda4ee..fc9c9d598 100644 --- a/deeplabcut/utils/plotting.py +++ b/deeplabcut/utils/plotting.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# """ DeepLabCut2.0 Toolbox (deeplabcut.org) © A. & M. Mathis Labs diff --git a/deeplabcut/utils/skeleton.py b/deeplabcut/utils/skeleton.py index 422758d1e..fab48dfb0 100644 --- a/deeplabcut/utils/skeleton.py +++ b/deeplabcut/utils/skeleton.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# """ DeepLabCut2.2 Toolbox (deeplabcut.org) © A. & M. Mathis Labs diff --git a/deeplabcut/utils/video_processor.py b/deeplabcut/utils/video_processor.py index 6d54dab07..5da9f7c54 100644 --- a/deeplabcut/utils/video_processor.py +++ b/deeplabcut/utils/video_processor.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# """ Author: Hao Wu hwu01@g.harvard.edu diff --git a/deeplabcut/utils/visualization.py b/deeplabcut/utils/visualization.py index 9c0bb0b67..d844651a2 100644 --- a/deeplabcut/utils/visualization.py +++ b/deeplabcut/utils/visualization.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# """ DeepLabCut2.0 Toolbox (deeplabcut.org) © A. & M. Mathis Labs diff --git a/deeplabcut/version.py b/deeplabcut/version.py index af573d3bf..98ed006fa 100644 --- a/deeplabcut/version.py +++ b/deeplabcut/version.py @@ -1,12 +1,13 @@ -""" -DeepLabCut2.0-2.2 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# -Please see AUTHORS for contributors. -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" - -__version__ = "2.3rc3" +__version__ = "2.3.0" VERSION = __version__ diff --git a/docs/PROJECT_GUI.md b/docs/PROJECT_GUI.md index 950802b29..770861595 100644 --- a/docs/PROJECT_GUI.md +++ b/docs/PROJECT_GUI.md @@ -10,7 +10,7 @@ As some users may be more comfortable working with an interactive interface, we (1) Install DeepLabCut using the simple-install with Anaconda found [here!](how-to-install)*. Now that you have deeplabcut installed, just go into your env (activate DEEPLABCUT) then run: -` pip install --upgrade --force-reinstall 'deeplabcut[gui,tf]'==2.3rc3` +` pip install --upgrade --force-reinstall 'deeplabcut[gui,tf]'` *Note, currently the latest GUI is a release candidate, so you need to specifically install the `rc` version. This will change once v2.3 is stable. diff --git a/docs/napariGUI.md b/docs/napariGUI.md index 25720d885..5b2e4381b 100644 --- a/docs/napariGUI.md +++ b/docs/napariGUI.md @@ -16,9 +16,9 @@ A napari plugin for keypoint annotation with DeepLabCut. You can install the full DeepLabCut napari-based GUI via [pip] by running this in your conda env: -` pip install 'deeplabcut[gui]'==2.3rc3` +` pip install 'deeplabcut[gui]'` -*please note, rc2 is currently up, but this will rapidly change. The stable release will be 2.3. +*please note this is available since v2.3 You can install the stand-alone `napari-deeplabcut` via [pip]: diff --git a/examples/COLAB/COLAB_DLC_ModelZoo.ipynb b/examples/COLAB/COLAB_DLC_ModelZoo.ipynb index 74e8c8680..705fc4ad6 100644 --- a/examples/COLAB/COLAB_DLC_ModelZoo.ipynb +++ b/examples/COLAB/COLAB_DLC_ModelZoo.ipynb @@ -57,7 +57,7 @@ "#click the play icon (this will take a few minutes to install all the dependencies!)\n", "#Install the latest DeepLabCut version from master:\n", "!pip install https://github.com/DeepLabCut/DeepLabCut/archive/master.zip\n", - "!pip install 'deeplabcut[tf,modelzoo]'==2.3rc3\n", + "!pip install 'deeplabcut[tf,modelzoo]'==2.3.0\n", "!pip install huggingface_hub\n", "%reload_ext numpy\n", "%reload_ext matplotlib\n", diff --git a/examples/test.sh b/examples/test.sh index bfdad60ef..0fd5ca047 100755 --- a/examples/test.sh +++ b/examples/test.sh @@ -6,7 +6,7 @@ rm -r OUT cd .. pip uninstall deeplabcut python3 setup.py sdist bdist_wheel -pip install dist/deeplabcut-2.3rc3-py3-none-any.whl +pip install dist/deeplabcut-2.3.0-py3-none-any.whl cd examples diff --git a/examples/testscript.py b/examples/testscript.py index ca8da93fd..c11a4acde 100644 --- a/examples/testscript.py +++ b/examples/testscript.py @@ -1,5 +1,15 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# """ Created on Tue Oct 2 13:56:11 2018 @author: alex diff --git a/examples/testscript_3d.py b/examples/testscript_3d.py index c9b31a0cb..67b5f8acf 100644 --- a/examples/testscript_3d.py +++ b/examples/testscript_3d.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# """ DeepLabCut2.0 Toolbox (deeplabcut.org) © A. & M. Mathis Labs diff --git a/examples/testscript_deterministicwithResNet152.py b/examples/testscript_deterministicwithResNet152.py index cd1f21a25..dbaf8c67b 100644 --- a/examples/testscript_deterministicwithResNet152.py +++ b/examples/testscript_deterministicwithResNet152.py @@ -1,5 +1,15 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# """ Created on Tue Oct 2 13:56:11 2018 @author: alex diff --git a/examples/testscript_mobilenets.py b/examples/testscript_mobilenets.py index 382b98a30..2929a8ddf 100644 --- a/examples/testscript_mobilenets.py +++ b/examples/testscript_mobilenets.py @@ -1,5 +1,15 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# """ Created on Tue Oct 2 13:56:11 2018 @author: alex diff --git a/examples/testscript_multianimal.py b/examples/testscript_multianimal.py index 40d981498..8c5943134 100644 --- a/examples/testscript_multianimal.py +++ b/examples/testscript_multianimal.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import os import deeplabcut import numpy as np diff --git a/examples/testscript_openfielddata.py b/examples/testscript_openfielddata.py index 7ee843b07..760464a24 100644 --- a/examples/testscript_openfielddata.py +++ b/examples/testscript_openfielddata.py @@ -1,5 +1,15 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# """ Created on Mon Nov 5 18:06:13 2018 diff --git a/examples/testscript_openfielddata_augmentationcomparison.py b/examples/testscript_openfielddata_augmentationcomparison.py index 50d632b80..c98b1944e 100644 --- a/examples/testscript_openfielddata_augmentationcomparison.py +++ b/examples/testscript_openfielddata_augmentationcomparison.py @@ -1,5 +1,15 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# """ This is a test script to compare the loaders and models. diff --git a/examples/testscript_pretrained_models.py b/examples/testscript_pretrained_models.py index fbe64c218..93f084fab 100644 --- a/examples/testscript_pretrained_models.py +++ b/examples/testscript_pretrained_models.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# """ Testscript human network diff --git a/examples/testscript_transreid.py b/examples/testscript_transreid.py index 33dc11707..029a27453 100644 --- a/examples/testscript_transreid.py +++ b/examples/testscript_transreid.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import os import deeplabcut import numpy as np diff --git a/reinstall.sh b/reinstall.sh index 2003a5f40..8432ccd94 100755 --- a/reinstall.sh +++ b/reinstall.sh @@ -1,3 +1,3 @@ pip uninstall deeplabcut python3 setup.py sdist bdist_wheel -pip install dist/deeplabcut-2.3rc3-py3-none-any.whl +pip install dist/deeplabcut-2.3.0-py3-none-any.whl diff --git a/requirements.txt b/requirements.txt index 52060404a..2082c8b24 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ +dlclibrary ipython filterpy ruamel.yaml>=0.15.0 diff --git a/setup.py b/setup.py index c26531b77..ddc1b5299 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ setuptools.setup( name="deeplabcut", - version="2.3rc3", + version="2.3.0", author="A. & M. Mathis Labs", author_email="alexander@deeplabcut.org", description="Markerless pose-estimation of user-defined features with deep learning", @@ -25,6 +25,7 @@ long_description_content_type="text/markdown", url="https://github.com/DeepLabCut/DeepLabCut", install_requires=[ + "dlclibrary", "filterpy>=1.4.4", "ruamel.yaml>=0.15.0", "imgaug>=0.4.0", diff --git a/tests/conftest.py b/tests/conftest.py index bf5ccbcb8..1e67d0ca9 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import numpy as np import os import pickle diff --git a/tests/test_auxfun_models.py b/tests/test_auxfun_models.py index 7d8d64a27..ed71122bc 100644 --- a/tests/test_auxfun_models.py +++ b/tests/test_auxfun_models.py @@ -1,12 +1,14 @@ -""" -DeepLabCut2.0 Toolbox (deeplabcut.org) -© A. & M. Mathis Labs -https://github.com/DeepLabCut/DeepLabCut -Please see AUTHORS for contributors. +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# -https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS -Licensed under GNU Lesser General Public License v3.0 -""" from pathlib import Path from tempfile import TemporaryDirectory diff --git a/tests/test_auxfun_multianimal.py b/tests/test_auxfun_multianimal.py index c7e9f3aa3..6e29c27e7 100644 --- a/tests/test_auxfun_multianimal.py +++ b/tests/test_auxfun_multianimal.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import networkx as nx import numpy as np import pandas as pd diff --git a/tests/test_auxiliaryfunctions.py b/tests/test_auxiliaryfunctions.py index b24777e02..d8ccacf1a 100644 --- a/tests/test_auxiliaryfunctions.py +++ b/tests/test_auxiliaryfunctions.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# from deeplabcut.utils import auxiliaryfunctions from deeplabcut.utils.auxfun_videos import SUPPORTED_VIDEOS diff --git a/tests/test_conversioncode.py b/tests/test_conversioncode.py index fcdfdafa6..3ec57e019 100644 --- a/tests/test_conversioncode.py +++ b/tests/test_conversioncode.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import os import pandas as pd from conftest import TEST_DATA_DIR diff --git a/tests/test_crossvalutils.py b/tests/test_crossvalutils.py index 9680b6e40..f95dfa1ea 100644 --- a/tests/test_crossvalutils.py +++ b/tests/test_crossvalutils.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import numpy as np import pickle from deeplabcut.pose_estimation_tensorflow.lib import crossvalutils diff --git a/tests/test_dataset_augmentation.py b/tests/test_dataset_augmentation.py index ba639a876..e6d6ca598 100644 --- a/tests/test_dataset_augmentation.py +++ b/tests/test_dataset_augmentation.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import imgaug.augmenters as iaa import numpy as np import pytest diff --git a/tests/test_inferenceutils.py b/tests/test_inferenceutils.py index 4ed4ff00a..2571506d0 100644 --- a/tests/test_inferenceutils.py +++ b/tests/test_inferenceutils.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import numpy as np import os import pickle diff --git a/tests/test_pose_multianimal_imgaug.py b/tests/test_pose_multianimal_imgaug.py index 956a3cf8f..0675ef3df 100644 --- a/tests/test_pose_multianimal_imgaug.py +++ b/tests/test_pose_multianimal_imgaug.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import numpy as np import os import pytest diff --git a/tests/test_predict_multianimal.py b/tests/test_predict_multianimal.py index 9118be1c3..300ff9214 100644 --- a/tests/test_predict_multianimal.py +++ b/tests/test_predict_multianimal.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import numpy as np import tensorflow as tf from deeplabcut.pose_estimation_tensorflow.core import predict_multianimal diff --git a/tests/test_stitcher.py b/tests/test_stitcher.py index 040e7c27e..8819a83fc 100644 --- a/tests/test_stitcher.py +++ b/tests/test_stitcher.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import numpy as np import pandas as pd import pytest diff --git a/tests/test_trackingutils.py b/tests/test_trackingutils.py index b5dcc3976..9ba4bd3e5 100644 --- a/tests/test_trackingutils.py +++ b/tests/test_trackingutils.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import numpy as np import pytest from deeplabcut.pose_estimation_tensorflow.lib import trackingutils diff --git a/tests/test_trainingsetmanipulation.py b/tests/test_trainingsetmanipulation.py index 99b0de0bf..07c41052e 100644 --- a/tests/test_trainingsetmanipulation.py +++ b/tests/test_trainingsetmanipulation.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import numpy as np import os import pandas as pd diff --git a/tests/test_triangulation.py b/tests/test_triangulation.py index e1e975d3f..5fed2f114 100644 --- a/tests/test_triangulation.py +++ b/tests/test_triangulation.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import numpy as np import pandas as pd import pytest diff --git a/tests/test_video.py b/tests/test_video.py index e0991dcb1..02b70e828 100644 --- a/tests/test_video.py +++ b/tests/test_video.py @@ -1,3 +1,13 @@ +# +# DeepLabCut Toolbox (deeplabcut.org) +# © A. & M.W. Mathis Labs +# https://github.com/DeepLabCut/DeepLabCut +# +# Please see AUTHORS for contributors. +# https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS +# +# Licensed under GNU Lesser General Public License v3.0 +# import os import pytest from conftest import TEST_DATA_DIR diff --git a/tests/tests_modelzoo.py b/tests/tests_modelzoo.py new file mode 100644 index 000000000..09cd628fd --- /dev/null +++ b/tests/tests_modelzoo.py @@ -0,0 +1,25 @@ +import dlclibrary +import os +import pytest +from dlclibrary.dlcmodelzoo.modelzoo_download import MODELOPTIONS + + +def test_download_huggingface_model(tmp_path_factory, model="full_cat"): + folder = tmp_path_factory.mktemp("temp") + dlclibrary.download_huggingface_model(model, str(folder)) + + assert os.path.exists(folder / "pose_cfg.yaml") + assert any(f.startswith("snapshot-") for f in os.listdir(folder)) + # Verify that the Hugging Face folder was removed + assert not any(f.startswith("models--") for f in os.listdir(folder)) + + +def test_download_huggingface_wrong_model(): + with pytest.raises(ValueError): + dlclibrary.download_huggingface_model("wrong_model_name") + + +@pytest.mark.skip +@pytest.mark.parametrize("model", MODELOPTIONS) +def test_download_all_models(tmp_path_factory, model): + test_download_huggingface_model(tmp_path_factory, model)