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

yolo_nas_tests.py 1.1 KB

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
26
27
28
29
30
31
32
33
34
35
36
37
38
  1. import unittest
  2. import torch
  3. from super_gradients.common.object_names import Models
  4. from super_gradients.training import models
  5. class TestYOLONAS(unittest.TestCase):
  6. def setUp(self):
  7. pass
  8. def test_yolo_nas_custom_in_channels(self):
  9. """
  10. Validate that we can create a YOLO-NAS model with custom in_channels.
  11. """
  12. model = models.get(Models.YOLO_NAS_S, arch_params=dict(in_channels=2), num_classes=17)
  13. model(torch.rand(1, 2, 640, 640))
  14. def test_yolo_nas_pose(self):
  15. """
  16. Validate that we can create a YOLO-NAS model with custom in_channels.
  17. """
  18. model = models.get(Models.YOLO_NAS_POSE_L, pretrained_weights="coco_pose")
  19. output = model(torch.rand(1, 3, 640, 640))
  20. assert len(output) == 2
  21. model = models.get(Models.YOLO_NAS_POSE_M, num_classes=17)
  22. output = model(torch.rand(1, 3, 640, 640))
  23. assert len(output) == 2
  24. model = models.get(Models.YOLO_NAS_POSE_S, num_classes=17)
  25. output = model(torch.rand(1, 3, 640, 640))
  26. assert len(output) == 2
  27. if __name__ == "__main__":
  28. unittest.main()
Tip!

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

Comments

Loading...