File size: 1,485 Bytes
4a690bb |
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 |
Setup Config
============
To set up your configuration, you will need to generate a configuration class based on :class:`~yolo.config.config.Config`, which can be achieved using `hydra <https://hydra.cc/>`_.
The configuration will include all the necessary settings for your ``task``, including general configuration, ``dataset`` information, and task-specific information (``train``, ``inference``, ``validation``).
Next, create the progress logger to handle the output and progress bar. This class is based on `rich <https://github.com/Textualize/rich>`_'s progress bar and customizes the logger (print function) using `loguru <https://loguru.readthedocs.io/>`_.
.. tabs::
.. tab:: decorator
.. code-block:: python
import hydra
from yolo import ProgressLogger
from yolo.config.config import Config
@hydra.main(config_path="config", config_name="config", version_base=None)
def main(cfg: Config):
progress = ProgressLogger(cfg, exp_name=cfg.name)
pass
.. tab:: initialize & compose
.. code-block:: python
from hydra import compose, initialize
from yolo import ProgressLogger
from yolo.config.config import Config
with initialize(config_path="config", version_base=None):
cfg = compose(config_name="config", overrides=["task=train", "model=v9-c"])
progress = ProgressLogger(cfg, exp_name=cfg.name)
TODO: add a config over view
|