forked from DeepLabCut/DeepLabCut
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestscript_superanimal_transfer_learning.py
More file actions
42 lines (37 loc) · 1.17 KB
/
testscript_superanimal_transfer_learning.py
File metadata and controls
42 lines (37 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#
# 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
#
"""
Test script for super animal adaptation
"""
import os
import deeplabcut
from deeplabcut.modelzoo.weight_initialization import build_weight_init
print(deeplabcut.__file__)
if __name__ == "__main__":
superanimal_name = "superanimal_topviewmouse"
basepath = os.path.dirname(os.path.realpath(__file__))
config_path = os.path.join(basepath, "openfield-Pranav-2018-10-30", "config.yaml")
model_name = "hrnet_w32"
detector_name = "fasterrcnn_resnet50_fpn_v2"
weight_init = build_weight_init(
cfg=config_path,
super_animal=superanimal_name,
model_name=model_name,
detector_name=detector_name,
with_decoder=False,
)
deeplabcut.create_training_dataset(config_path, weight_init=weight_init)
deeplabcut.train_network(
config_path,
epochs=1,
superanimal_name=superanimal_name,
superanimal_transfer_learning=True,
)