Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unified Cores and Cleanup #57

Merged
merged 33 commits into from
Aug 19, 2024
Merged

Unified Cores and Cleanup #57

merged 33 commits into from
Aug 19, 2024

Conversation

kozlov721
Copy link
Collaborator

@kozlov721 kozlov721 commented Aug 15, 2024

Unified all Core subclasses into LuxonisModel

  • luxonis_train.core.Core renamed to LuxonisModel
  • luxonis_train.models.LuxonisModel renamed to LuxonisLightningModule
  • Instead of Trainer, Inferer, Exporter etc., there is only LuxonisModel
  • Solves various issues with incorrectly created runs / creating empty runs / saving files related to one run to multiple different places etc.

Before:

from luxonis_train.core import Trainer, Exporter, Archiver

trainer = Trainer(config)
trainer.train()
exporter = Exporter(config)
exporter.export()
archiver = Archiver(config)
archiver.archive()

This would create the following directories:

.
├── output
│   ├── 0-lavender-junglefowl
│   │   ├── best_val_metric
│   │   ├── config.yaml
│   │   ├── luxonis_train.log
│   │   └── min_val_loss
│   ├── 1-peach-vole
│   ├── 2-white-gorilla
│   │   ├── config.yaml
│   │   └── luxonis_train.log
│   └── 3-cyan-sawfish
│       ├── config.yaml
│       └── luxonis_train.log
├── output_archive
│   └── nn_archive_onnx.tar.xz
└── output_export
    └── model.onnx

Now:

from luxonis_train.core import LuxonisModel

model = LuxonisModel(config)
model.train()
model.export()
model.archive()
./output/0-lavender-junglefowl/
├── archive
│   └── model.onnx.tar.xz
├── export
│   ├── model.onnx
│   └── model.yaml
├── config.yaml
├── luxonis_train.log
├── best_val_metric
└── min_val_loss

Miscellaneous

  • added type hints to luxonis_ml.nodes.blocks
  • reusing functions from luxonis_ml instead of defining them again
  • removed unused config values
  • renamed BaseLoader.input_shape to BaseLoader.input_shapes
  • added upload_to_run option to exporter and tracker configuration sections
    • True by default
    • uploads the generated files as artifacts to the current run

@kozlov721 kozlov721 added enhancement New feature or request tests Adding or changing tests labels Aug 15, 2024
@kozlov721 kozlov721 requested a review from klemen1999 August 15, 2024 08:44
@kozlov721 kozlov721 self-assigned this Aug 15, 2024
Copy link

github-actions bot commented Aug 15, 2024

Test Results

  3 files    3 suites   32m 45s ⏱️
 51 tests  49 ✅ 0 💤 2 ❌
132 runs  128 ✅ 1 💤 3 ❌

For more details on these failures, see this check.

Results for commit 491bf0d.

♻️ This comment has been updated with latest results.

@kozlov721 kozlov721 merged commit 9b17a70 into dev Aug 19, 2024
3 of 8 checks passed
@kozlov721 kozlov721 deleted the feature/unify-cores branch August 19, 2024 13:28
kozlov721 added a commit that referenced this pull request Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request tests Adding or changing tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants