Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

pose_estimation_sample_test.py 924 B

You have to be logged in to leave a comment. Sign In
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
  1. import unittest
  2. import numpy as np
  3. from super_gradients.training.samples import PoseEstimationSample
  4. class PoseEstimationSampleTest(unittest.TestCase):
  5. def test_compute_joints_areas(self):
  6. joints = np.array(
  7. [
  8. [[10, 20, 1], [20, 30, 1], [15, 25, 1], [16, 23, 1]],
  9. [[10, 20, 1], [20, 30, 1], [15, 25, 0], [16, 23, 0]],
  10. [[15, 25, 0], [10, 20, 0], [20, 30, 1], [15, 25, 1]],
  11. [[15, 25, 0], [10, 20, 0], [20, 30, 1], [15, 25, 0]],
  12. [[15, 25, 0], [10, 20, 0], [20, 30, 0], [15, 25, 0]],
  13. ]
  14. )
  15. areas = PoseEstimationSample.compute_area_of_joints_bounding_box(joints)
  16. self.assertAlmostEquals(areas[0], 100)
  17. self.assertAlmostEquals(areas[1], 100)
  18. self.assertAlmostEquals(areas[2], 25)
  19. self.assertAlmostEquals(areas[3], 0)
  20. self.assertAlmostEquals(areas[4], 0)
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...