─░├žeri─če ge├ž

Referans i├žin ultralytics/models/yolo/obb/train.py

Not

Bu dosya https://github.com/ultralytics/ultralytics/blob/main/ ultralytics/models/ yolo/obb/train .py adresinde mevcuttur. Bir sorun tespit ederseniz l├╝tfen bir ├çekme ─░ste─či ­čŤá´ŞĆ ile katk─▒da bulunarak d├╝zeltilmesine yard─▒mc─▒ olun. Te┼čekk├╝rler ­čÖĆ!



ultralytics.models.yolo.obb.train.OBBTrainer

├ťsler: DetectionTrainer

Y├Ânlendirilmi┼č S─▒n─▒rlay─▒c─▒ Kutu (OBB) modeline dayal─▒ e─čitim i├žin DetectionTrainer s─▒n─▒f─▒n─▒ geni┼čleten bir s─▒n─▒f.

├ľrnek
from ultralytics.models.yolo.obb import OBBTrainer

args = dict(model='yolov8n-obb.pt', data='dota8.yaml', epochs=3)
trainer = OBBTrainer(overrides=args)
trainer.train()
Kaynak kodu ultralytics/models/yolo/obb/train.py
class OBBTrainer(yolo.detect.DetectionTrainer):
    """
    A class extending the DetectionTrainer class for training based on an Oriented Bounding Box (OBB) model.

    Example:
        ```python
        from ultralytics.models.yolo.obb import OBBTrainer

        args = dict(model='yolov8n-obb.pt', data='dota8.yaml', epochs=3)
        trainer = OBBTrainer(overrides=args)
        trainer.train()
        ```
    """

    def __init__(self, cfg=DEFAULT_CFG, overrides=None, _callbacks=None):
        """Initialize a OBBTrainer object with given arguments."""
        if overrides is None:
            overrides = {}
        overrides["task"] = "obb"
        super().__init__(cfg, overrides, _callbacks)

    def get_model(self, cfg=None, weights=None, verbose=True):
        """Return OBBModel initialized with specified config and weights."""
        model = OBBModel(cfg, ch=3, nc=self.data["nc"], verbose=verbose and RANK == -1)
        if weights:
            model.load(weights)

        return model

    def get_validator(self):
        """Return an instance of OBBValidator for validation of YOLO model."""
        self.loss_names = "box_loss", "cls_loss", "dfl_loss"
        return yolo.obb.OBBValidator(self.test_loader, save_dir=self.save_dir, args=copy(self.args))

__init__(cfg=DEFAULT_CFG, overrides=None, _callbacks=None)

Verilen ba─č─▒ms─▒z de─či┼čkenlerle bir OBBTrainer nesnesini ba┼člat─▒r.

Kaynak kodu ultralytics/models/yolo/obb/train.py
def __init__(self, cfg=DEFAULT_CFG, overrides=None, _callbacks=None):
    """Initialize a OBBTrainer object with given arguments."""
    if overrides is None:
        overrides = {}
    overrides["task"] = "obb"
    super().__init__(cfg, overrides, _callbacks)

get_model(cfg=None, weights=None, verbose=True)

Belirtilen yap─▒land─▒rma ve a─č─▒rl─▒klarla ba┼člat─▒lm─▒┼č OBBModel'i d├Ând├╝r├╝r.

Kaynak kodu ultralytics/models/yolo/obb/train.py
def get_model(self, cfg=None, weights=None, verbose=True):
    """Return OBBModel initialized with specified config and weights."""
    model = OBBModel(cfg, ch=3, nc=self.data["nc"], verbose=verbose and RANK == -1)
    if weights:
        model.load(weights)

    return model

get_validator()

YOLO modelinin do─črulanmas─▒ i├žin bir OBBValidator ├Ârne─či d├Ând├╝r├╝r.

Kaynak kodu ultralytics/models/yolo/obb/train.py
def get_validator(self):
    """Return an instance of OBBValidator for validation of YOLO model."""
    self.loss_names = "box_loss", "cls_loss", "dfl_loss"
    return yolo.obb.OBBValidator(self.test_loader, save_dir=self.save_dir, args=copy(self.args))





Created 2024-01-05, Updated 2024-06-02
Authors: glenn-jocher (4), sergiuwaxmann (1), Burhan-Q (1)