Skip to content

Track Ultralytics predict() without double counting - #84

Merged
piotrekno1 merged 1 commit into
develfrom
fix/ultralytics-predict
Oct 20, 2026
Merged

piotrekno1 merged 1 commit into
develfrom
fix/ultralytics-predict

Conversation

@piotrekno1

Copy link
Copy Markdown
Collaborator

Ultralytics applications calling model.predict(image) currently emit no inference telemetry because the SDK patches only model(...). Patch the instance's predict method instead: YOLO.__call__ delegates to it, so both entry points now emit exactly one event using the existing timing, metadata and error handling.

Promotes the existing predict regression from expected failure to a passing compatibility test. Adds checks for calling both entry points, repeated hook installation, unregistered-instance isolation and error propagation. Test doubles now reproduce Ultralytics' actual call-to-predict delegation.

Fixes #72.

Validation

  • Full SDK suite: 777 passed, 28 skipped.
  • Real Ultralytics 8.4.182 inference: all 4 compatibility tests passed.
  • Minimum supported Ultralytics 8.0.200: all 53 integration unit and compatibility tests passed.
  • Real inference tests build YOLO from YAML and use a blank image, with no downloaded weights. Tested on Python 3.12, macOS, NumPy 1.26.4 and PyTorch 2.14.1; upstream excludes the Linux matrix's NumPy 2.2.6 pin on macOS.
  • Ruff lint, formatting and whitespace checks pass.

This is scoped to eager predictions. The pre-existing lazy stream=True timing/consumption behavior needs a separate lifecycle fix; this PR does not claim correct streaming lifecycle tracking.

@github-actions

Copy link
Copy Markdown

Coverage report

  • Total: 88% (10728/12172 lines)

Top uncovered files

  • wildedge/integrations/mlx.py: 28.7% (122 lines missed)
  • wildedge/integrations/transformers.py: 62.9% (112 lines missed)
  • wildedge/integrations/ultralytics.py: 67.7% (86 lines missed)
  • wildedge/integrations/pytorch.py: 57.5% (79 lines missed)
  • wildedge/platforms/macos.py: 56.8% (67 lines missed)

@piotrekno1
piotrekno1 merged commit 05691eb into devel Oct 20, 2026
14 checks passed
@piotrekno1
piotrekno1 deleted the fix/ultralytics-predict branch October 20, 2026 16:51
@github-actions github-actions Bot mentioned this pull request Oct 21, 2026
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.

ultralytics model.predict() is not tracked

1 participant