Skip to content

Commit

Permalink
Merge pull request #1442 from roboflow/feat/metrics-module-initial
Browse files Browse the repository at this point in the history
Core system for Metrics
  • Loading branch information
LinasKo authored Aug 28, 2024
2 parents 7600bef + 55c8c07 commit f1124e0
Show file tree
Hide file tree
Showing 13 changed files with 1,331 additions and 54 deletions.
5 changes: 4 additions & 1 deletion docs/detection/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
comments: true
---

# Metrics
# Legacy Metrics

Starting with `0.23.0`, a new metrics module is being introduced to supervision.
Metrics here are part of the legacy evaluation API and will be deprecated in the future.

<div class="md-typeset">
<h2><a href="#supervision.metrics.detection.ConfusionMatrix">ConfusionMatrix</a></h2>
Expand Down
18 changes: 18 additions & 0 deletions docs/metrics/mean_average_precision.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
comments: true
status: new
---

# Mean Average Precision

<div class="md-typeset">
<h2><a href="#supervision.metrics.mean_average_precision.MeanAveragePrecision">MeanAveragePrecision</a></h2>
</div>

:::supervision.metrics.mean_average_precision.MeanAveragePrecision

<div class="md-typeset">
<h2><a href="#supervision.metrics.mean_average_precision.MeanAveragePrecisionResult">MeanAveragePrecisionResult</a></h2>
</div>

:::supervision.metrics.mean_average_precision.MeanAveragePrecisionResult
92 changes: 44 additions & 48 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ extra_css:
- stylesheets/extra.css
- stylesheets/cookbooks-card.css


nav:
- Supervision: index.md
- Learn:
Expand All @@ -45,50 +44,50 @@ nav:
- Process Datasets: how_to/process_datasets.md

- Reference - Code API:
- Detection and Segmentation:
- Core: detection/core.md
- Annotators: detection/annotators.md
- Metrics: detection/metrics.md
- Double Detection Filter: detection/double_detection_filter.md
- Utils: detection/utils.md
- Keypoint Detection:
- Core: keypoint/core.md
- Annotators: keypoint/annotators.md
- Classification:
- Core: classification/core.md
- Tools:
- Line Zone: detection/tools/line_zone.md
- Polygon Zone: detection/tools/polygon_zone.md
- Inference Slicer: detection/tools/inference_slicer.md
- Detection Smoother: detection/tools/smoother.md
- Save Detections: detection/tools/save_detections.md
- Trackers: trackers.md
- Datasets:
- Core: datasets/core.md
- Utils: datasets/utils.md
- Utils:
- Video: utils/video.md
- Image: utils/image.md
- Iterables: utils/iterables.md
- Notebook: utils/notebook.md
- File: utils/file.md
- Draw: utils/draw.md
- Geometry: utils/geometry.md
- Assets: assets.md
- Detection and Segmentation:
- Core: detection/core.md
- Annotators: detection/annotators.md
- Double Detection Filter: detection/double_detection_filter.md
- Utils: detection/utils.md
- Keypoint Detection:
- Core: keypoint/core.md
- Annotators: keypoint/annotators.md
- Classification:
- Core: classification/core.md
- Tools:
- Line Zone: detection/tools/line_zone.md
- Polygon Zone: detection/tools/polygon_zone.md
- Inference Slicer: detection/tools/inference_slicer.md
- Detection Smoother: detection/tools/smoother.md
- Save Detections: detection/tools/save_detections.md
- Trackers: trackers.md
- Datasets:
- Core: datasets/core.md
- Utils: datasets/utils.md
- Metrics:
- mAP: metrics/mean_average_precision.md
- Legacy Metrics: detection/metrics.md
- Utils:
- Video: utils/video.md
- Image: utils/image.md
- Iterables: utils/iterables.md
- Notebook: utils/notebook.md
- File: utils/file.md
- Draw: utils/draw.md
- Geometry: utils/geometry.md
- Assets: assets.md
- Cookbooks: cookbooks.md
- Cheatsheet: https://roboflow.github.io/cheatsheet-supervision/
- Contribute:
- Contributing: contributing.md
- Code of Conduct: code_of_conduct.md
- License: license.md
- Contributing: contributing.md
- Code of Conduct: code_of_conduct.md
- License: license.md
- Release Notes:
- Changelog: changelog.md
- Deprecated: deprecated.md


- Changelog: changelog.md
- Deprecated: deprecated.md

theme:
name: 'material'
name: "material"
icon:
edit: material/pencil
logo: assets/supervision-lenny.png
Expand All @@ -105,19 +104,18 @@ theme:
palette:
# Palette for light mode
- scheme: default
primary: 'custom'
primary: "custom"
toggle:
icon: material/brightness-7
name: Switch to dark mode

# Palette toggle for dark mode
- scheme: slate
primary: 'custom'
primary: "custom"
toggle:
icon: material/brightness-4
name: Switch to light mode


font:
text: Roboto
code: Roboto Mono
Expand All @@ -128,10 +126,10 @@ theme:
plugins:
- search
- mkdocs-jupyter:
kernel_name: python3
execute: false
include_source: True
include_requirejs: true
kernel_name: python3
execute: false
include_source: True
include_requirejs: true
- mkdocstrings:
default_handler: python
handlers:
Expand All @@ -155,8 +153,6 @@ plugins:
- git-revision-date-localized:
enable_creation_date: true



markdown_extensions:
- admonition
- pymdownx.details
Expand Down
112 changes: 111 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,19 @@ scipy = [
matplotlib = ">=3.6.0"
pyyaml = ">=5.3"
defusedxml = "^0.7.1"
pillow = ">=9.4"
opencv-python = { version = ">=4.5.5.64", optional = true }
opencv-python-headless = ">=4.5.5.64"
requests = { version = ">=2.26.0,<=2.32.3", optional = true }
tqdm = { version = ">=4.62.3,<=4.66.5", optional = true }
pillow = ">=9.4"
# pandas: picked lowest major version that supports Python 3.8
pandas = { version = ">=2.0.0", optional = true }
pandas-stubs = { version = ">=2.0.0.230412", optional = true }

[tool.poetry.extras]
desktop = ["opencv-python"]
assets = ["requests", "tqdm"]
metrics = ["pandas", "pandas-stubs"]

[tool.poetry.group.dev.dependencies]
twine = "^5.1.1"
Expand All @@ -79,7 +83,6 @@ docutils = [
{ version = "^0.21.1", python = ">=3.9" },
]


[tool.poetry.group.docs.dependencies]
mkdocs-material = { extras = ["imaging"], version = "^9.5.5" }
mkdocstrings = { extras = ["python"], version = "^0.25.2" }
Expand Down
10 changes: 10 additions & 0 deletions supervision/metrics/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from supervision.metrics.core import CLASS_ID_NONE, Metric, MetricTarget
from supervision.metrics.mean_average_precision import (
MeanAveragePrecision,
MeanAveragePrecisionResult,
)
from supervision.metrics.utils.object_size import (
ObjectSizeCategory,
get_detection_size_category,
get_object_size_category,
)
Loading

0 comments on commit f1124e0

Please sign in to comment.