Thanks to visit codestin.com
Credit goes to github.com

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

[MLOps 1.5] Expand the built-ins: CV#862

Merged
dbogunowicz merged 7 commits into
mainfrom
feature/damian/cv_builtins
Jan 13, 2023
Merged

[MLOps 1.5] Expand the built-ins: CV#862
dbogunowicz merged 7 commits into
mainfrom
feature/damian/cv_builtins

Conversation

@dbogunowicz

@dbogunowicz dbogunowicz commented Jan 11, 2023

Copy link
Copy Markdown
Contributor

Feature description

  • Added built-in functions: detected_classes, number_detected_objects, mean_score_per_detection, std_score_per_detection.
  • Removed a few built-ins, simplified a few, and added exhaustive unit tests.
  • Now built-ins either return a single float/int or a dictionary (so that in the future we can easily extract the information from the built-in functions and send them to loggers via FunctionLogger).

Coverage:

As specified in the PRD:

cv_image_width
cv_image_height --> those two functions are covered by "image_shape"

cv_image_mean_pixel_r_channel
cv_image_mean_pixel_g_channel
cv_image_mean_pixel_b_channel --> those three functions are covered by "mean_pixels_per_channel"

cv_image_percent_0_pixels -> "fraction_zeros"

cv_num_classes_predicted - count of the number of unique classes in yolo/yolact -> "detected_classes"
cv_num_bboxes_predicted - count of the number of objects detected in yolo/yolact -> "number_detected_objects"

cv_mean_bbox_score - mean score for a prediction in yolo/yolact
cv_max_bbox_score - mean score for a prediction in yolo/yolact
cv_min_bbox_score - min score for a prediction in yolo/yolact -> covered by  "mean_score_per_detection" and "std_score_per_detection"

Comment thread src/deepsparse/yolo/schemas.py
@dbogunowicz dbogunowicz marked this pull request as ready for review January 11, 2023 14:54
@corey-nm

Copy link
Copy Markdown
Contributor

What does a configuration of actually using these look like? If I wanted to use a classes thing and an image thing I'd have to specify something like:

pipeline_outputs.image:
    - std_per_channel
pipeline_outputs.classes:
    - count_num_classes

?

corey-nm
corey-nm previously approved these changes Jan 11, 2023

@corey-nm corey-nm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm, would be good to see some frontend examples to see how usable these all are

Comment thread tests/deepsparse/loggers/metric_functions/cv/test_built_ins.py
Comment thread tests/deepsparse/loggers/metric_functions/cv/test_built_ins.py
Comment thread tests/deepsparse/loggers/metric_functions/cv/test_built_ins.py
Comment thread tests/deepsparse/loggers/metric_functions/cv/test_built_ins.py
@dbogunowicz

Copy link
Copy Markdown
Contributor Author

What does a configuration of actually using these look like? If I wanted to use a classes thing and an image thing I'd have to specify something like:

pipeline_outputs.image:
    - std_per_channel
pipeline_outputs.classes:
    - count_num_classes

?

pipeline_outputs.image:
    - func: std_per_channel
pipeline_outputs.classes:
    - func: count_num_classes

@bfineran bfineran left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks great overall, few comments

Comment thread src/deepsparse/loggers/metric_functions/cv/__init__.py Outdated
Comment thread src/deepsparse/loggers/metric_functions/cv/built_ins.py Outdated
Comment thread src/deepsparse/loggers/metric_functions/cv/built_ins.py Outdated
Comment thread src/deepsparse/loggers/metric_functions/cv/built_ins.py Outdated
Comment thread src/deepsparse/loggers/metric_functions/cv/built_ins.py Outdated
Comment thread src/deepsparse/loggers/metric_functions/cv/built_ins.py Outdated
Comment thread src/deepsparse/loggers/metric_functions/cv/built_ins.py Outdated
Comment thread src/deepsparse/loggers/metric_functions/cv/built_ins.py Outdated
Comment thread src/deepsparse/loggers/metric_functions/cv/built_ins.py Outdated
Comment thread src/deepsparse/loggers/metric_functions/cv/built_ins.py Outdated
@dbogunowicz dbogunowicz requested a review from bfineran January 12, 2023 09:23

@corey-nm corey-nm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm!

@dbogunowicz dbogunowicz merged commit ba5ce84 into main Jan 13, 2023
@dbogunowicz dbogunowicz deleted the feature/damian/cv_builtins branch January 13, 2023 15:48
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