-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* support for custom loaders and datasets * updated configs * custom loaders in inspect command * updated inspect for multi-task labels * removed custom loader from test config * deleted comment * deleted comment * removed custom dataset * removed comment * skipping archiver test untill fixed in luxonis-ml * [Automated] Updated coverage badge --------- Co-authored-by: GitHub Actions <[email protected]>
- Loading branch information
1 parent
32fb0e0
commit 0a5d3f2
Showing
27 changed files
with
239 additions
and
227 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
from .attached_modules import * | ||
from .core import * | ||
from .models import * | ||
from .utils import * | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,14 @@ | ||
import lightning.pytorch as pl | ||
from luxonis_ml.data import LuxonisDataset, ValAugmentations | ||
from torch.utils.data import DataLoader | ||
|
||
from luxonis_train.utils.config import Config | ||
from luxonis_train.utils.loaders import LuxonisLoaderTorch, collate_fn | ||
import luxonis_train | ||
from luxonis_train.utils.registry import CALLBACKS | ||
|
||
|
||
@CALLBACKS.register_module() | ||
class TestOnTrainEnd(pl.Callback): | ||
"""Callback to perform a test run at the end of the training.""" | ||
|
||
def on_train_end(self, trainer: pl.Trainer, pl_module: pl.LightningModule) -> None: | ||
cfg: Config = pl_module.cfg | ||
|
||
dataset = LuxonisDataset( | ||
dataset_name=cfg.dataset.name, | ||
team_id=cfg.dataset.team_id, | ||
dataset_id=cfg.dataset.id, | ||
bucket_type=cfg.dataset.bucket_type, | ||
bucket_storage=cfg.dataset.bucket_storage, | ||
) | ||
|
||
loader_test = LuxonisLoaderTorch( | ||
dataset, | ||
view=cfg.dataset.test_view, | ||
augmentations=ValAugmentations( | ||
image_size=cfg.trainer.preprocessing.train_image_size, | ||
augmentations=[ | ||
i.model_dump() for i in cfg.trainer.preprocessing.augmentations | ||
], | ||
train_rgb=cfg.trainer.preprocessing.train_rgb, | ||
keep_aspect_ratio=cfg.trainer.preprocessing.keep_aspect_ratio, | ||
), | ||
) | ||
pytorch_loader_test = DataLoader( | ||
loader_test, | ||
batch_size=cfg.trainer.batch_size, | ||
num_workers=cfg.trainer.num_workers, | ||
collate_fn=collate_fn, | ||
) | ||
trainer.test(pl_module, pytorch_loader_test) | ||
def on_train_end( | ||
self, trainer: pl.Trainer, pl_module: "luxonis_train.models.LuxonisModel" | ||
) -> None: | ||
trainer.test(pl_module, pl_module._core.pytorch_loaders["test"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
from .archiver import Archiver | ||
from .core import Core | ||
from .exporter import Exporter | ||
from .inferer import Inferer | ||
from .trainer import Trainer | ||
from .tuner import Tuner | ||
|
||
__all__ = ["Exporter", "Trainer", "Tuner", "Inferer", "Archiver"] | ||
__all__ = ["Exporter", "Trainer", "Tuner", "Inferer", "Archiver", "Core"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.