Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

Conversation

dsikka
Copy link
Contributor

@dsikka dsikka commented Jul 21, 2023

Summary

  • Updated deepsparse support for yolov8
  • Small similar changes to the ones made for sparseml's yolov8 update
  • process_engine_outputs has a slight change. Previously providing nm for number of masks, which is no longer used by the yolov8 non_max_suppression function.

Testing:

  • Tested locally using both sparsezoo and yolov8 models for both segmentation and detection
  • Workflows tested: pipeline creation and forward pass, annotation, eval and benchmarking

sparsezoo models tested:

  1. detection: "zoo:cv/detection/yolov8-m/pytorch/ultralytics/coco/base_quant-none"
  2. segmentation: "zoo:cv/segmentation/yolov8-n/pytorch/ultralytics/coco/base-none"

yolov8 models tested:

  1. detection: yolov8n.pt
  2. segmentation: yolov8n-seg.pt

Pipeline creation + forward pass:

Detection

from deepsparse import Pipeline
model_path = "yolov8n.onnx" 
images = ["basilica.jpg"]
yolo_pipeline = Pipeline.create(
    task="yolov8",
    model_path=model_path,
)
pipeline_outputs = yolo_pipeline(images=images)

Segmentation:

from deepsparse import Pipeline
model_path = "yolov8n-seg.onnx" 
images = ["basilica.jpg"]
yolo_pipeline = Pipeline.create(
    task="yolov8",
    subtask="segmentation",
    model_path=model_path,
)

pipeline_outputs = yolo_pipeline(images=images)

Annotation:

Detection:
deepsparse.yolov8.annotate --source basilica.jpg --model_filepath "yolov8n.onnx"
Segmentation:
deepsparse.yolov8.annotate --source basilica.jpg --model_filepath "yolov8n-seg.onnx" --subtask segmentation

Results verified for outputs produced by both workflows above

Eval

Detection:
deepsparse.yolov8.eval --model_path yolov8n.onnx
Segementation:
deepsparse.yolov8.eval --model_path yolov8n-seg.onnx --subtask segmentation

@dsikka dsikka marked this pull request as ready for review July 24, 2023 17:56
@dsikka dsikka requested review from dbogunowicz, rahul-tuli, abhinavnmagic, bfineran and anmarques and removed request for dbogunowicz July 24, 2023 18:00
bfineran
bfineran previously approved these changes Jul 24, 2023
@dsikka dsikka merged commit 982938b into main Jul 25, 2023
@dsikka dsikka deleted the yolov8_update branch July 25, 2023 14:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants