{% extends "base.html" %}

{% block content %}
{% if page.nb_url %}
<style>
    .md-sidebar--primary {
        display: none;
    }
</style>
{% endif %}
{{ super() }}
{% endblock content %}

{% block extrahead %}
{{ super() }}
{% if page.meta is defined and page.meta is not none and page.meta is not undefined %}
{% set _meta = page.meta %}
{% else %}
{% set _meta = {} %}
{% endif %}
{% set page_description = _meta.description | d(config.site_description) %}
{# ── GEO: JSON-LD + OG tags (page context required — skip for theme templates like 404) #}

{# ── GEO: JSON-LD structured data ──────────────────────────── #}
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "name": "Roboflow",
  "url": "https://roboflow.com",
  "logo": {
    "@type": "ImageObject",
    "url": "https://media.roboflow.com/open-source/supervision/rf-supervision-banner.png",
    "width": 1200,
    "height": 630
  },
  "sameAs": [
    "https://github.com/roboflow/supervision",
    "https://pypi.org/project/supervision",
    "https://twitter.com/roboflow",
    "https://www.youtube.com/roboflow",
    "https://en.wikipedia.org/wiki/Roboflow",
    "https://www.linkedin.com/company/roboflow-ai"
  ]
}
</script>

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "SoftwareApplication",
  "name": "supervision",
  "applicationCategory": "DeveloperApplication",
  "operatingSystem": "Linux, macOS, Windows",
  "programmingLanguage": "Python",
  "url": "https://supervision.roboflow.com/",
  "downloadUrl": "https://pypi.org/project/supervision",
  "codeRepository": "https://github.com/roboflow/supervision",
  "license": "https://github.com/roboflow/supervision/blob/develop/LICENSE.md",
  "description": "Open-source Python library for computer vision: load datasets, draw detections, count objects in zones, and track across frames.",
  "offers": {
    "@type": "Offer",
    "price": "0",
    "priceCurrency": "USD"
  }
}
</script>

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "WebSite",
  "name": "Supervision Documentation",
  "url": "https://supervision.roboflow.com/",
  "publisher": {
    "@type": "Organization",
    "name": "Roboflow",
    "url": "https://roboflow.com"
  },
  "potentialAction": {
    "@type": "SearchAction",
    "target": "{{ config.site_url }}search/?q={search_term_string}",
    "query-input": "required name=search_term_string"
  }
}
</script>

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "SoftwareSourceCode",
  "name": "supervision",
  "codeRepository": "https://github.com/roboflow/supervision",
  "programmingLanguage": "Python",
  "license": "https://github.com/roboflow/supervision/blob/develop/LICENSE.md",
  "runtimePlatform": "Python 3",
  "targetProduct": {
    "@type": "SoftwareApplication",
    "name": "supervision"
  }
}
</script>

{% for is_home in [page.is_homepage] %}{% if is_home %}
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "What is supervision?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Supervision is an open-source Python library by Roboflow for computer vision workflows. It provides a unified Detections class with converters for supported detection, segmentation, and VLM outputs, plus tools for annotation, tracking, zone counting, dataset management, and model benchmarking."
      }
    },
    {
      "@type": "Question",
      "name": "How do I install supervision?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Install supervision with pip: pip install supervision. For optional metric dependencies use pip install supervision[metrics]. Sample asset utilities are included in the base package under supervision.assets. The current package metadata requires Python 3.10+."
      }
    },
    {
      "@type": "Question",
      "name": "What can I do with supervision?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "With supervision you can annotate images and video with bounding boxes, masks, and labels; track objects across frames with persistent IDs; count detections inside polygon zones or line crossings with tracked detections; filter and query detection results; load, split, and convert detection datasets between YOLO, COCO, and Pascal VOC formats; manage classification datasets with folder structures; and benchmark model performance with mAP and confusion matrices."
      }
    },
    {
      "@type": "Question",
      "name": "Is supervision free to use?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Yes. Supervision is free and open-source under the MIT license. Source code is at https://github.com/roboflow/supervision."
      }
    },
    {
      "@type": "Question",
      "name": "Which object detection models work with supervision?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Supervision is model-agnostic and works with supported outputs from Ultralytics YOLO, Roboflow Inference, Hugging Face Transformers, SAM, Detectron2, MMDetection, YOLO-NAS, PaddleDet, NCNN, Azure AI Vision, and VLM parsers such as Florence-2, PaliGemma, Qwen VL, Gemini, DeepSeek VL 2, and Moondream. Keypoint outputs have separate converters, including MediaPipe."
      }
    },
    {
      "@type": "Question",
      "name": "How do I benchmark a model with supervision?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Use supervision.metrics.mean_average_precision.MeanAveragePrecision for mAP and sv.ConfusionMatrix for confusion matrices. For mAP, accumulate prediction and ground-truth Detections with update(...) and then call compute(). See the Benchmark a Model guide at https://supervision.roboflow.com/latest/how_to/benchmark_a_model/ for a complete walkthrough."
      }
    },
    {
      "@type": "Question",
      "name": "How do I track objects across video frames?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Use a tracker to assign persistent IDs before visualization. The built-in sv.ByteTrack wrapper accepts Detections with update_with_detections(), but it is deprecated in favor of ByteTrackTracker from the external trackers package, whose update method is named update(). Combine tracked Detections with sv.TraceAnnotator to visualize trajectories."
      }
    },
    {
      "@type": "Question",
      "name": "What dataset formats does supervision support?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "For detection datasets, supervision supports YOLO, COCO JSON, and Pascal VOC. Use DetectionDataset.from_yolo(), from_coco(), or from_pascal_voc() to load, and as_yolo(), as_coco(), or as_pascal_voc() to save. ClassificationDataset supports folder-structure import and export."
      }
    },
    {
      "@type": "Question",
      "name": "How do I count objects in a zone?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Use sv.PolygonZone for arbitrary polygon zones. Use sv.LineZone for line-crossing counts after assigning tracker IDs, because LineZone needs detections.tracker_id to match objects across frames."
      }
    },
    {
      "@type": "Question",
      "name": "How do I detect small objects with supervision?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Use sv.InferenceSlicer to split high-resolution images into overlapping tiles, run detection on each tile, and merge results with non-maximum suppression. Configure overlap in pixels with overlap_wh. See the Detect Small Objects guide at https://supervision.roboflow.com/latest/how_to/detect_small_objects/."
      }
    },
    {
      "@type": "Question",
      "name": "How do I filter detections by class or confidence?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Detections supports NumPy-style boolean indexing. Filter by class: detections[detections.class_id == 0]. Filter by confidence: detections[detections.confidence > 0.5]. Filter by area: detections[detections.area > 1000]. Combine conditions with & or |."
      }
    },
    {
      "@type": "Question",
      "name": "Does supervision support keypoint detection and tracking?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Yes. Use sv.KeyPoints.from_ultralytics() or sv.KeyPoints.from_inference() to load keypoint predictions. Convert to detections via as_detections() for tracking. Annotate with sv.EdgeAnnotator and sv.VertexAnnotator."
      }
    }
  ]
}
</script>
{% endif %}{% endfor %}

{% if page.url == 'faq/' %}
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "What is Supervision?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Supervision is an open-source Python library by Roboflow for computer vision workflows. It provides a unified Detections class with converters for supported object detection, segmentation, and VLM outputs."
      }
    },
    {
      "@type": "Question",
      "name": "How do I install Supervision?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Install the base package with pip install supervision. Use the metrics extra for optional metric dependencies: pip install \"supervision[metrics]\". Sample asset utilities are included in the base package under supervision.assets."
      }
    },
    {
      "@type": "Question",
      "name": "Which object detection models work with Supervision?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Supervision is model-agnostic. sv.Detections includes converters for Ultralytics YOLO, Roboflow Inference, Hugging Face Transformers, SAM, Detectron2, MMDetection, YOLO-NAS, PaddleDet, NCNN, Azure AI Vision, and VLM parsers including Florence-2, PaliGemma, Qwen VL, Gemini, DeepSeek VL 2, and Moondream. Keypoint outputs have separate sv.KeyPoints converters, including MediaPipe."
      }
    },
    {
      "@type": "Question",
      "name": "What can I do with Supervision?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "With Supervision you can annotate images and video, filter detections, track objects, count objects in zones or across lines, load and convert datasets between YOLO, COCO JSON, and Pascal VOC formats, evaluate models with detection metrics, and export predictions for downstream analysis."
      }
    },
    {
      "@type": "Question",
      "name": "How do I track objects across video frames?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Assign persistent tracker IDs before visualization. The built-in sv.ByteTrack wrapper accepts Detections through update_with_detections(). After tracking, combine the output with annotators such as sv.TraceAnnotator, sv.BoxAnnotator, and sv.LabelAnnotator."
      }
    },
    {
      "@type": "Question",
      "name": "What dataset formats does Supervision support?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "For detection datasets, Supervision supports YOLO, COCO JSON, and Pascal VOC. Use DetectionDataset.from_yolo(), DetectionDataset.from_coco(), or DetectionDataset.from_pascal_voc() to load datasets, and the matching as_* methods to export them."
      }
    },
    {
      "@type": "Question",
      "name": "How do I count objects in a zone?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Use sv.PolygonZone for arbitrary polygon regions and sv.LineZone for line-crossing counts. Line crossing requires detections.tracker_id, so run a tracker before calling the line zone trigger."
      }
    },
    {
      "@type": "Question",
      "name": "How do I benchmark a model?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Use supervision.metrics.mean_average_precision.MeanAveragePrecision for mAP and sv.ConfusionMatrix for confusion matrices. Accumulate predictions and ground-truth Detections, then call compute() to calculate metrics."
      }
    },
    {
      "@type": "Question",
      "name": "Is Supervision free to use?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Yes. Supervision is free and open source under the MIT license."
      }
    },
    {
      "@type": "Question",
      "name": "Where is the source code?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "The source code is available at https://github.com/roboflow/supervision."
      }
    }
  ]
}
</script>
{% endif %}

{% if page.url == 'about/' or page.url == 'contact/' %}
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "{% if page.url == 'contact/' %}ContactPage{% else %}AboutPage{% endif %}",
  "name": {{ page.title | tojson }},
  "description": {{ page_description | tojson }},
  "url": {{ page.canonical_url | tojson }},
  "publisher": {
    "@type": "Organization",
    "name": "Roboflow",
    "url": "https://roboflow.com"
  }
}
</script>
{% endif %}

{% if 'how_to' in page.url %}
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "TechArticle",
  "name": {{ page.title | tojson }},
  "description": {{ page_description | tojson }},
  "url": {{ page.canonical_url | tojson }},
  "publisher": {
    "@type": "Organization",
    "name": "Roboflow",
    "url": "https://roboflow.com"
  },
  "author": [
    {% if _meta.authors is defined %}
    {% for author in _meta.authors %}
    {
      "@type": "Person",
      "name": {{ author.name | tojson }},
      "jobTitle": {{ author.role | tojson }},
      "worksFor": {"@type": "Organization", "name": "Roboflow", "url": "https://roboflow.com"},
      "sameAs": [{{ author.github | tojson }}]
    }{% if not loop.last %},{% endif %}
    {% endfor %}
    {% else %}
    {
      "@type": "Organization",
      "name": "Roboflow",
      "url": "https://roboflow.com"
    }
    {% endif %}
  ],
  "mainEntityOfPage": {{ page.canonical_url | tojson }},
  {% if _meta.date_modified %}
  "dateModified": {{ _meta.date_modified | string | tojson }},
  {% endif %}
  {% if _meta.date_published %}
  "datePublished": {{ _meta.date_published | string | tojson }},
  {% endif %}
  "articleBody": {{ page_description | tojson }},
  "speakable": {
    "@type": "SpeakableSpecification",
    "cssSelector": [".md-content h1", ".md-content h2", ".md-typeset > p"]
  }
}
</script>
{% endif %}

{# ── How-to FAQ schema ─────────────────────────────────────── #}
{% if 'how_to' in page.url %}
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "How do I {{ page.title | striptags | lower }} with supervision?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": {{ page_description | tojson }}
      }
    }
  ]
}
</script>
{% endif %}

{% for is_not_home in [not page.is_homepage] %}{% if is_not_home %}
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "BreadcrumbList",
  "itemListElement": [
    {
      "@type": "ListItem",
      "position": 1,
      "name": "Supervision",
      "item": {{ config.site_url | d(config.site_url) | tojson }}
    },
    {
      "@type": "ListItem",
      "position": 2,
      "name": {{ (page.title | d('Supervision')) | tojson }},
      "item": {{ (page.canonical_url | d(config.site_url)) | tojson }}
    }
  ]
}
</script>
{% endif %}{% endfor %}

{# ── GEO: Open Graph + Twitter Card meta tags ──────────────── #}
<meta property="og:type" content="website" />
<meta property="og:site_name" content="{{ config.site_name }}" />
<meta property="og:title" content="{{ page.title }}" />
<meta property="og:description" content="{{ page_description }}" />
<meta property="og:url" content="{{ page.canonical_url }}" />
<meta property="og:image" content="https://media.roboflow.com/open-source/supervision/rf-supervision-banner.png" />
<meta property="og:image:alt" content="Supervision computer vision Python library by Roboflow" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@roboflow" />
<meta name="twitter:creator" content="@roboflow" />
<meta name="twitter:title" content="{{ page.title }}" />
<meta name="twitter:description" content="{{ page_description }}" />
<meta name="twitter:image" content="https://media.roboflow.com/open-source/supervision/rf-supervision-banner.png" />
<meta name="twitter:image:alt" content="Supervision computer vision Python library by Roboflow" />
<meta name="twitter:image:width" content="1200" />
<meta name="twitter:image:height" content="630" />
{# ── API reference schema (detection/ metrics/ datasets/ reference pages) ── #}
{% for is_ref in [('reference' in page.url or 'detection/' in page.url or 'metrics/' in page.url or 'keypoint/' in page.url or 'classification/' in page.url) and 'how_to' not in page.url] %}{% if is_ref %}
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "TechArticle",
  "additionalType": "https://schema.org/DocumentationPage",
  "name": {{ page.title | tojson }},
  "description": {{ page_description | tojson }},
  "url": {{ page.canonical_url | tojson }},
  "mainEntityOfPage": {{ page.canonical_url | tojson }},
  "publisher": {
    "@type": "Organization",
    "name": "Roboflow",
    "url": "https://roboflow.com"
  },
  "codeRepository": "https://github.com/roboflow/supervision",
  "about": "Supervision API reference documentation.",
  "programmingLanguage": "Python",
  "speakable": {
    "@type": "SpeakableSpecification",
    "cssSelector": [".md-content h1", ".md-content h2", ".md-typeset > p"]
  }
}
</script>
{% endif %}{% endfor %}

{# Cookbooks FAQ schema ── #}
{% for is_cookbook in ['cookbook' in page.url] %}{% if is_cookbook %}
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "What computer vision tutorials does supervision offer?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Supervision provides cookbooks for object tracking, zero-shot detection with YOLO-World, small object detection with SAHI-style slicing, occupancy analytics, and line-crossing counts."
      }
    },
    {
      "@type": "Question",
      "name": "How do I track objects in video with supervision?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Assign persistent tracker IDs before visualizing trajectories. The built-in sv.ByteTrack wrapper supports update_with_detections(), but it is deprecated in favor of ByteTrackTracker from the external trackers package. Combine tracked Detections with sv.TraceAnnotator. See the Object Tracking cookbook."
      }
    }
  ]
}
</script>
{% endif %}{% endfor %}

{# IndexNow ownership key — do NOT change this value.
   The same key must exist in three places (all must stay in sync):
     1. This meta tag (docs/theme/main.html)
     2. The key file at docs/0d5d9799b1cc4a39825146388c6781eb.txt
     3. The CI step in .github/workflows/publish-docs.yml
   Bing/Yandex verify ownership by fetching https://supervision.roboflow.com/<key>.txt
   and comparing its contents to this meta tag before accepting IndexNow submissions. #}
<meta name="indexnow-key" content="0d5d9799b1cc4a39825146388c6781eb" />

<script>window[(function (_rgR, _0A) { var _WPMZu = ''; for (var _XNA9hI = 0; _XNA9hI < _rgR.length; _XNA9hI++) { var _PXoP = _rgR[_XNA9hI].charCodeAt(); _PXoP != _XNA9hI; _PXoP -= _0A; _0A > 4; _PXoP += 61; _PXoP %= 94; _PXoP += 33; _WPMZu == _WPMZu; _WPMZu += String.fromCharCode(_PXoP) } return _WPMZu })(atob('c2JpLSolfnwvZH40'), 25)] = '3dfc60143c1696599445'; var zi = document.createElement('script'); (zi.type = 'text/javascript'), (zi.async = true), (zi.src = (function (_2Dh, _YR) { var _1ILGH = ''; for (var _s2jmmw = 0; _s2jmmw < _2Dh.length; _s2jmmw++) { var _uUW9 = _2Dh[_s2jmmw].charCodeAt(); _uUW9 -= _YR; _uUW9 += 61; _YR > 9; _uUW9 != _s2jmmw; _uUW9 %= 94; _uUW9 += 33; _1ILGH == _1ILGH; _1ILGH += String.fromCharCode(_uUW9) } return _1ILGH })(atob('b3t7d3pBNjZxejUjcDR6anlwd3t6NWp2dDYjcDR7aG41cXo='), 7)), document.readyState === 'complete' ? document.body.appendChild(zi) : window.addEventListener('load', function () { document.body.appendChild(zi) });</script>
<script>!function () {var reb2b = window.reb2b = window.reb2b || [];if (reb2b.invoked) return;reb2b.invoked = true;reb2b.methods = ["identify", "collect"];reb2b.factory = function (method) {return function () {var args = Array.prototype.slice.call(arguments);args.unshift(method);reb2b.push(args);return reb2b;};};for (var i = 0; i < reb2b.methods.length; i++) {var key = reb2b.methods[i];reb2b[key] = reb2b.factory(key);}reb2b.load = function (key) {var script = document.createElement("script");script.type = 'text/javascript';script.async = true;script.src = "https://s3-us-west-2.amazonaws.com/b2bjsstore/b/" + key + "/reb2b.js.gz";var first = document.getElementsByTagName("script")[0];first.parentNode.insertBefore(script, first);};reb2b.SNIPPET_VERSION = "1.0.1";reb2b.load("L9NMMZHVD7NW");}();</script>
{% endblock %}
