Skip to content

Update tutorial dependencies and conversion notebooks#93

Open
rolandocortez wants to merge 8 commits into
mainfrom
bump-tutorial-deps-hubai-depthai
Open

Update tutorial dependencies and conversion notebooks#93
rolandocortez wants to merge 8 commits into
mainfrom
bump-tutorial-deps-hubai-depthai

Conversation

@rolandocortez

@rolandocortez rolandocortez commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Purpose

Update tutorial dependency pins for the HubAI SDK / DepthAI / Luxonis package bump and fix the affected conversion notebooks so they remain reproducible with the updated package stack.

Reviewer guide

The main review areas are:

  • conversion/pytorch_conversion.ipynb: dependency alignment, HubAI SDK migration, artifact path handling, and runtime cleanup changes.
  • conversion/onnx_conversion.ipynb: model asset download flow, standalone ONNX generation, NN Archive generation, HubAI SDK migration, and DepthAI runtime path handling.
  • conversion/nvidia_tao_conversion.ipynb: dependency bump and HubAI SDK migration. Full TAO export was not run end-to-end because it requires Docker / NGC authentication and TAO runtime setup.
  • training/**: mostly mechanical dependency pin bumps. training/train_detection_model.ipynb was used as the representative training validation notebook.

Specification

This PR updates the relevant tutorial notebooks to the newer dependency pins, including:

  • latest hubai-sdk, installed unpinned with -U
  • luxonis-train==0.4.5
  • luxonis-ml==0.8.5
  • depthai==3.7.1
  • depthai-nodes==0.5.1
  • modelconv==0.5.5

Main changes:

PyTorch conversion notebook

Updated conversion/pytorch_conversion.ipynb and fixed issues needed to run it reproducibly in a clean / Colab-style environment.

Notable changes:

  • Aligned the Luxonis / ModelConverter dependency set.
  • Removed aggressive reinstall / upgrade flags from the main install cell.
  • Pinned the PyTorch / TorchVision pair validated with the RVC2 conversion flow.
  • Kept the TorchScript-based ONNX export path with opset_version=18 and dynamo=False for RVC2 / OpenVINO Model Optimizer compatibility.
  • Added downloads for missing tutorial assets so the notebook works in fresh environments.
  • Updated HubAI SDK usage to install the latest unpinned version with -U.
  • Updated converted artifact handling to use output_dir and response.downloaded_path.
  • Made the DepthAI runtime cell safer to rerun by checking device availability and cleaning up runtime / visualizer resources.
  • Fixed artifact output directory handling for the direct ONNX conversion example.

ONNX conversion notebook

Updated conversion/onnx_conversion.ipynb and fixed reproducibility issues found while validating the notebook.

Notable changes:

  • Updated dependency pins.
  • Replaced the unavailable FFNet-54S model download flow with the current downloadable asset.
  • Removed assumptions about the old internal ZIP layout by locating the ONNX dynamically.
  • Added download handling for the tutorial image asset when missing.
  • Handled the current upstream ONNX external-data format by saving a standalone ONNX before NN Archive generation.
  • Updated NN Archive generation so the archive config points to the actual packaged ONNX file.
  • Updated HubAI SDK usage to install the latest unpinned version with -U.
  • Updated converted artifact handling to use output_dir and response.downloaded_path.
  • Updated DepthAI runtime path handling to use the generated / downloaded artifact.

NVIDIA TAO conversion notebook

Updated conversion/nvidia_tao_conversion.ipynb.

Notable changes:

  • Updated dependency pins.
  • Updated HubAI SDK usage to install the latest unpinned version with -U.
  • Updated converted artifact handling to use output_dir and response.downloaded_path.
  • Replaced the SciPy cosine similarity helper with a NumPy implementation to avoid requiring an extra dependency for that small calculation.

Training notebooks

Bumped dependency pins across the training notebooks.

The training changes were kept minimal and mechanical to avoid notebook output / metadata churn.

Dependencies & Potential Impact

This affects tutorial notebook dependencies and conversion / training tutorial execution.

Some flows still require external setup, such as:

  • HubAI credentials
  • DepthAI hardware / runtime
  • Docker / NGC authentication for the NVIDIA TAO tutorial

The NVIDIA TAO tutorial was not validated end-to-end because the full TAO export flow requires Docker / NGC authentication and TAO runtime setup.

Deployment Plan

None / not applicable. This PR only updates tutorial notebooks.

Testing & Validation

Validation performed:

  • PyTorch conversion notebook was validated end-to-end, including dependency installation, ONNX export, HubAI / RVC2 conversion, and local DepthAI runtime with an OAK / RVC2 device.
  • ONNX conversion notebook was validated through model download / preparation, ONNXRuntime inference, standalone ONNX generation, NN Archive generation, HubAI / RVC2 conversion, and DepthAI runtime on an OAK / RVC2 device.
  • NVIDIA TAO conversion notebook dependency installation and HubAI SDK migration were reviewed, but full TAO export / conversion was not run end-to-end because it requires Docker / NGC authentication and TAO runtime setup.
  • training/train_detection_model.ipynb was validated in a fresh local environment through dataset creation, training, test, inference, and prediction visualization.
  • Conversion / deployment cells in the training notebook were not executed because they require HubAI credentials and DepthAI device / runtime.

AI Usage

Assisted-by: ChatGPT

Submitted code was reviewed by a human: YES

The author is taking the responsibility for the contribution: YES

@rolandocortez rolandocortez requested a review from klemen1999 June 12, 2026 10:13

@klemen1999 klemen1999 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

General comments:

  • We should keep some outputs of the cells commited so it's quicker to see what's happening. Basically cells that had output visible before should have it now as well
  • We should always use the latest hubai-sdk because this is actively being adjusted based on the underlying REST API from Hub. This means that we shouldn't have it pinned anywhere (just leave it at pip install -U hubai-sdk for example) , we should just in code make sure that we are passing parameters, calling functions, etc that work with current latest HubAI SDK

Comment thread conversion/pytorch_conversion.ipynb
Comment thread conversion/pytorch_conversion.ipynb
Comment thread conversion/onnx_conversion.ipynb
Comment thread training/datadreamer/generate_dataset_and_train_yolo.ipynb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants