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

#367 fix: Request correct hydra-core

Merged
Ghost merged 1 commits into Deci-AI:master from deci-ai:hotfix/ALG-000_hydra-req
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
43
44
  1. import unittest
  2. import torch
  3. from super_gradients.training.models.detection_models.yolox import YoloX_N, YoloX_T, YoloX_S, YoloX_M, YoloX_L, YoloX_X
  4. from super_gradients.training.utils.utils import HpmStruct
  5. class TestYOLOX(unittest.TestCase):
  6. def setUp(self) -> None:
  7. self.arch_params = HpmStruct(num_classes=10)
  8. self.yolo_classes = [YoloX_N, YoloX_T, YoloX_S, YoloX_M, YoloX_L, YoloX_X]
  9. def test_yolox_creation(self):
  10. """
  11. test_yolox_creation - Tests the creation of the models
  12. :return:
  13. """
  14. dummy_input = torch.randn(1, 3, 320, 320)
  15. with torch.no_grad():
  16. for yolo_cls in self.yolo_classes:
  17. yolo_model = yolo_cls(self.arch_params)
  18. # THIS SHOULD RUN THE FORWARD ONCE
  19. yolo_model.eval()
  20. output_standard = yolo_model(dummy_input)
  21. self.assertIsNotNone(output_standard)
  22. # THIS SHOULD RUN A TRAINING FORWARD
  23. yolo_model.train()
  24. output_train = yolo_model(dummy_input)
  25. self.assertIsNotNone(output_train)
  26. # THIS SHOULD RUN THE FORWARD AUGMENT
  27. yolo_model.eval()
  28. yolo_model.augmented_inference = True
  29. output_augment = yolo_model(dummy_input)
  30. self.assertIsNotNone(output_augment)
  31. if __name__ == '__main__':
  32. unittest.main()
Discard
Tip!

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