Skip to content

Conversation

@dtronmans
Copy link
Contributor

Purpose

  • HubAI conversion: this is a new exporter, it takes as argument the platform and all other conversion parameters (eg: number_of_shaves) can be passed in the params
  • Deprecate blobconverter: heavily discouraged through warnings
  • Add ConvertOnTrainEnd callback: this performs export + archive
  • Discourage the use of both ExportOnTrainEnd and ArchiveOnTrainEnd simultaneously and encourage the new ConvertOnTrainEnd callback

Specification

  • The convert method runs both export and archive unconditionally: it is no longer possible to separately run an export step and an archive step. This shouldn't be a problem, I realized that we always "forced" users to have both ArchiveOnTrainEnd and ExportOnTrainEnd callbacks active thanks to smart_auto_populate(), so isolated use of either ArchiveOnTrainEnd or ExportOnTrainEnd wasn't really happening in the first place.
  • The export method no longer runs the blobconverter
  • ConvertOnTrainEnd without an exporter defined: generates the ONNX and the NNArchive ONNX only
  • Convert as a CLI command: as an example you can do luxonis_train convert --config fruit_detection_config.yaml --weights output/51-salmon-dingo/best_val_metric/bestfruit.ckpt exporter.hubai.platform rvc4
  • Small mistake that I made during the PR for unique ONNX identifiers, back then I changed it from a param in the method to a config parameter but forgot to remove the docstring parameter (this is fixed in this PR)

Dependencies & Potential Impact

Deployment Plan

Testing & Validation

As a callback at the end of training:

exporter:
  data_type: fp16
  hubai:
    active: true
    platform: rvc2
    params:
      number_of_shaves: 8
intraining

CLI:

luxonis_train convert --config fruit_detection_config.yaml --weights output/51-salmon-dingo/best_val_metric/bestfruit.ckpt exporter.hubai.platform rvc4

cli

@dtronmans dtronmans self-assigned this Jan 9, 2026
@dtronmans dtronmans requested a review from a team as a code owner January 9, 2026 14:30
@dtronmans dtronmans added the enhancement New feature or request label Jan 9, 2026
@dtronmans dtronmans requested review from conorsim, klemen1999, kozlov721 and tersekmatija and removed request for a team January 9, 2026 14:30
@github-actions github-actions bot added documentation Improvements or additions to documentation tests Adding or changing tests CLI Changes affecting the CLI labels Jan 9, 2026
Copy link
Collaborator

@klemen1999 klemen1999 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some initial comments, didn't actually test the code yet though

f"Converting NNArchive to {(cfg.platform or 'rvc2').upper()} format using HubAI SDK"
)

precision_map = {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll wait a bit on this because this/next week a change in HubAI will come where INT8INT16 precision will get introduced. After that we'll properly adjust here as well if needed (TBD)

@dtronmans dtronmans marked this pull request as draft January 12, 2026 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLI Changes affecting the CLI documentation Improvements or additions to documentation enhancement New feature or request tests Adding or changing tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants