-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shaokai/sa transfer learning #2389
Shaokai/sa transfer learning #2389
Conversation
…eepLabCut into shaokai/SA_transfer_learning
…eepLabCut into shaokai/SA_transfer_learning
adding clarifications on the examples
Update ModelZoo.md
@@ -1,12 +1,14 @@ | |||
# Project definitions (do not edit) | |||
# Project definitions (do not edit) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd revert changes automatically made to this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two small changes to bring and looking good!
Co-authored-by: Jessy Lauer <30733203+jeylau@users.noreply.github.com>
Changes made @jeylau |
This looks great to me, with clear docs: all clear @n-poulsen / @AlexEMG ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
black
needs to be run on the code, as there are a few style changes to update (i suggested some changes but there are more).
I'd also like us to change the commit history for the PR before merging. There are heavy artifacts that we added and then removed from the branch (removed in commits removed artifacts and removed more artifacts), but they're still in the git history.
@@ -95,6 +95,7 @@ def format_multianimal_training_data( | |||
return train_data | |||
|
|||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there should only be 2 blank lines between functions :)
@@ -717,6 +719,7 @@ def to_matlab_cell(array): | |||
return train_data, matlab_data | |||
|
|||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 blank lines again
@@ -728,6 +731,7 @@ def create_training_dataset( | |||
net_type=None, | |||
augmenter_type=None, | |||
posecfg_template=None, | |||
superanimal_name = "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a bit of styling to follow the rest of the file
superanimal_name = "" | |
superanimal_name="", |
@@ -832,16 +840,28 @@ def create_training_dataset( | |||
|
|||
# Loading metadata from config file: | |||
cfg = auxiliaryfunctions.read_config(config) | |||
dlc_root_path = auxiliaryfunctions.get_deeplabcut_path() | |||
|
|||
if superanimal_name!="": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think all these suggestions can be applied at once by running black on the code.
if superanimal_name!="": | |
if superanimal_name != "": |
if posecfg_template: | ||
if not posecfg_template.endswith("pose_cfg.yaml"): | ||
if not posecfg_template.endswith("pose_cfg.yaml") and not posecfg_template.endswith("superquadruped.yaml") and not posecfg_template.endswith("supertopview.yaml"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line is too long, apply black
@@ -119,7 +119,10 @@ def before_adapt_inference(self, make_video=False, **kwargs): | |||
customized_test_config=self.customized_pose_config, | |||
) | |||
if kwargs.pop("plot_trajectories", True): | |||
_plot_trajectories(datafiles[0]) | |||
if len(datafiles) == 0: | |||
print ('No data files found for plotting trajectory') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
print ('No data files found for plotting trajectory') | |
print('No data files found for plotting trajectory') |
@@ -45,7 +45,8 @@ def train( | |||
traintime_resize=False, | |||
video_path="", | |||
superanimal=None, | |||
trim_ends = None # trim the both ends of the video for video adaptation | |||
trim_ends = None, # trim the both ends of the video for video adaptation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trim_ends
is not used in the function
@n-poulsen ran black and removed unused parameters |
Let's fix merge conflicts? |
Thanks @yeshaokai for running black! I've fixed the merge conflict; looking good to me now. |
SuperAnimal transfer learning API, example and docs