Definition at line 9 of file stgcn_runner.py.
◆ __init__()
| stgcn_runner.STGCNRunner.__init__ |
( |
| self, |
|
|
| backbone, |
|
|
| head, |
|
|
| device = 'cuda:0' ) |
input:
model_cfg :
model_checkpoint :
device :
Definition at line 10 of file stgcn_runner.py.
10 def __init__(self, backbone, head, device='cuda:0'):
11 """
12 input:
13 model_cfg :
14 model_checkpoint :
15 device :
16 """
17 super().__init__()
18 self.backbone = build_action_model(backbone)
19 self.head = build_action_model(head)
20 self.device = device
21
22
◆ forward()
| stgcn_runner.STGCNRunner.forward |
( |
| self, |
|
|
| x ) |
Definition at line 43 of file stgcn_runner.py.
43 def forward(self, x):
44 return self.inference(x['keypoints'])
◆ inference()
| stgcn_runner.STGCNRunner.inference |
( |
| self, |
|
|
| x ) |
Definition at line 37 of file stgcn_runner.py.
37 def inference(self, x):
38 feat = self.backbone(x)
39 scores = self.head(feat)
40 action_labels = scores.argmax()
41 return {'action_labels':action_labels, 'scores':scores}
42
◆ make_action_input()
| stgcn_runner.STGCNRunner.make_action_input |
( |
| self, |
|
|
| pose_list, |
|
|
| img_shape ) |
Definition at line 23 of file stgcn_runner.py.
23 def make_action_input(self, pose_list, img_shape):
24 pass
25
◆ run_recognizer()
| stgcn_runner.STGCNRunner.run_recognizer |
( |
| self, |
|
|
| pose_results, |
|
|
| img_shape = None ) |
Definition at line 26 of file stgcn_runner.py.
26 def run_recognizer(self, pose_results, img_shape=None):
27 if self.use_valid_check and not utils.check_valid(pose_results, self.k):
28 return None
29
30 if self.use_dummy_pose:
31 pose_results = utils.insert_dummy_pose(pose_results)
32
33 data = self.make_action_input(pose_results, img_shape)
34
35 return self.inference(data)
36
◆ backbone
| stgcn_runner.STGCNRunner.backbone |
◆ device
| stgcn_runner.STGCNRunner.device |
◆ head
| stgcn_runner.STGCNRunner.head |
| stgcn_runner.STGCNRunner.k |
The documentation for this class was generated from the following file: