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

#657 Segmentation Readme

Merged
Ghost merged 1 commits into Deci-AI:master from deci-ai:feature/SG-594-segmentation_readme
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
  1. from typing import Union, Any
  2. from omegaconf import DictConfig
  3. from super_gradients.training.utils import HpmStruct
  4. from super_gradients.common.factories.base_factory import BaseFactory
  5. from super_gradients.modules.detection_modules import ALL_DETECTION_MODULES
  6. class DetectionModulesFactory(BaseFactory):
  7. def __init__(self):
  8. super().__init__(ALL_DETECTION_MODULES)
  9. @staticmethod
  10. def insert_module_param(conf: Union[str, dict, HpmStruct, DictConfig], name: str, value: Any):
  11. """
  12. Assign a new parameter for the module
  13. :param conf: a module config, either {type_name(str): {parameters...}} or just type_name(str)
  14. :param name: parameter name
  15. :param value: parameter value
  16. :return: an update config {type_name(str): {name: value, parameters...}}
  17. """
  18. if isinstance(conf, str):
  19. return {conf: {name: value}}
  20. cls_type = list(conf.keys())[0]
  21. conf[cls_type][name] = value
  22. return conf
Discard
Tip!

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