Skip to content

External Yolo-template recipe fails to import in a clean pip install (undeclared deps: object-detection-metrics/podm, ultralytics, shapely) #363

Closed

Description

Summary

An external recipe that uses the built-in Yolo template cannot be imported or validated in a clean environment created with pip install qai-hub-models, because several packages that the template imports at module load are not declared as dependencies of the base package. Following EXTERNAL_ONBOARDING.md end-to-end, the first qai-hub-models validate <folder> fails with ModuleNotFoundError.

Environment

  • qai_hub_models 0.66.0 (pip), qai_hub 0.56.0
  • Python 3.12, clean venv, Linux x86_64
  • External recipe with templates: [yolo], model subclassing qai_hub_models.models.templates.yolo.model.Yolo

Steps to reproduce

  1. python -m venv venv && venv/bin/pip install qai-hub-models
  2. Create an external recipe whose model.py imports the Yolo template (same pattern as the in-tree yolox recipe).
  3. Run qai-hub-models validate <recipe_folder> (or simply import qai_hub_models.models.templates.yolo.model).

Actual behavior

Import fails in stages; each missing package must be discovered and installed manually:

  1. qai_hub_models/models/templates/detection/detection_evaluator.py:14
    from podm.metrics import BoundingBox, MetricPerClass, get_pascal_voc_metrics
    → ModuleNotFoundError: No module named 'podm'
    Note: the PyPI package literally named podm is an unrelated Object-JSON mapper. As the comment in detection_evaluator.py says, this import is provided by the object-detection-metrics package — but nothing installs or declares it.
  2. After installing object-detection-metrics: podm/coco.py fails with ModuleNotFoundError: No module named 'shapely'.
  3. qai_hub_models/models/templates/yolo/yolo_segmentation_evaluator.py:10
    from ultralytics.utils.ops import process_mask
    → ModuleNotFoundError: No module named 'ultralytics'

After manually installing object-detection-metrics, shapely and ultralytics, the same recipe validates cleanly (28 passed, 0 failed, 0 warnings), so the recipe code itself is fine — only the dependency declarations are missing.

Expected behavior

One of:

  • the base package declares the template runtime dependencies it imports unconditionally, or
  • validate's install step installs the dependencies of the templates declared in the recipe's manifest.yaml, or
  • EXTERNAL_ONBOARDING.md lists these extra packages as required for template-based recipes.

In-tree development masks this because the repo dev environment installs everything; external contributors hit it on their first recipe.

Activity

  1. kory commented on Nov 18, 2026

    @kory
    Contributor

    Hi AI & Computer Vision Engineer in Tokyo | Edge AI, Model Optimization & Multimedia Systems | Author of Dancing with AI (@anguoyang) ,

    It looks like you missed running qai-hub-models install <yolo_model_name>. Running install will include the object-detection-metrics and ultralytics packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions