From 93a9a0dc788013054457866a408af1b286ef5bf6 Mon Sep 17 00:00:00 2001 From: Sierra Guequierre Date: Mon, 13 Jan 2025 13:57:55 -0500 Subject: [PATCH 1/7] Add generic service alias --- docs/dev/reference/apis/services/generic.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/dev/reference/apis/services/generic.md b/docs/dev/reference/apis/services/generic.md index 0fe8417f8a..cbdc85245b 100644 --- a/docs/dev/reference/apis/services/generic.md +++ b/docs/dev/reference/apis/services/generic.md @@ -10,6 +10,7 @@ images: ["/icons/components/generic.svg"] date: "2022-01-01" aliases: - /appendix/apis/services/generic/ + - /services/generic/ # updated: "" # When the content was last entirely checked --- From f4c94cddec7668e404ac1a9110ad6185c009923d Mon Sep 17 00:00:00 2001 From: Sierra Guequierre Date: Mon, 13 Jan 2025 14:01:54 -0500 Subject: [PATCH 2/7] Add mlmodel service alias --- docs/data-ai/ai/deploy.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/data-ai/ai/deploy.md b/docs/data-ai/ai/deploy.md index 5941195188..dc54c9ab75 100644 --- a/docs/data-ai/ai/deploy.md +++ b/docs/data-ai/ai/deploy.md @@ -18,6 +18,7 @@ aliases: - /ml/upload-model/ - /services/ml/ml-models/ - /registry/ml-models/ + - /services/ml/deploy/ --- The Machine Learning (ML) model service allows you to deploy [machine learning models](/data-ai/ai/deploy/#deploy-your-ml-model) to your machine. From 2921061655338f1ae6e967ddb32ccba1ae907f58 Mon Sep 17 00:00:00 2001 From: Sierra Guequierre Date: Mon, 13 Jan 2025 14:08:39 -0500 Subject: [PATCH 3/7] prettier --- docs/dev/reference/apis/services/generic.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/dev/reference/apis/services/generic.md b/docs/dev/reference/apis/services/generic.md index cbdc85245b..79aab9c3c0 100644 --- a/docs/dev/reference/apis/services/generic.md +++ b/docs/dev/reference/apis/services/generic.md @@ -10,7 +10,7 @@ images: ["/icons/components/generic.svg"] date: "2022-01-01" aliases: - /appendix/apis/services/generic/ - - /services/generic/ + - /services/generic/ # updated: "" # When the content was last entirely checked --- From f5590b65e838628fe6d6b3d6882483e0c845d199 Mon Sep 17 00:00:00 2001 From: Sierra Guequierre Date: Mon, 13 Jan 2025 14:53:54 -0500 Subject: [PATCH 4/7] Remove extra reference section --- docs/dev/reference/apis/services/vision.md | 15 +- .../reference/services/vision/_index.md | 24 - .../services/vision/color_detector.md | 340 ---------- .../services/vision/detector_3d_segmenter.md | 170 ----- .../reference/services/vision/mlmodel.md | 634 ------------------ .../services/vision/obstacles_depth.md | 203 ------ .../services/vision/obstacles_distance.md | 156 ----- .../services/vision/obstacles_pointcloud.md | 188 ------ 8 files changed, 8 insertions(+), 1722 deletions(-) delete mode 100644 docs/operate/reference/services/vision/_index.md delete mode 100644 docs/operate/reference/services/vision/color_detector.md delete mode 100644 docs/operate/reference/services/vision/detector_3d_segmenter.md delete mode 100644 docs/operate/reference/services/vision/mlmodel.md delete mode 100644 docs/operate/reference/services/vision/obstacles_depth.md delete mode 100644 docs/operate/reference/services/vision/obstacles_distance.md delete mode 100644 docs/operate/reference/services/vision/obstacles_pointcloud.md diff --git a/docs/dev/reference/apis/services/vision.md b/docs/dev/reference/apis/services/vision.md index 0294c2a988..d6faf95152 100644 --- a/docs/dev/reference/apis/services/vision.md +++ b/docs/dev/reference/apis/services/vision.md @@ -6,13 +6,14 @@ type: "docs" tags: ["vision", "computer vision", "CV", "services"] description: "Give commands to get detections, classifications, or point cloud objects, depending on the ML model the vision service is using." aliases: - - /services/vision/ - - /ml/vision/detection/ - - /ml/vision/classification/ - - /ml/vision/segmentation/ - - /services/vision/segmentation/ - - /ml/vision/ - - /appendix/apis/services/vision/ + - /services/vision/ + - /ml/vision/detection/ + - /ml/vision/classification/ + - /ml/vision/segmentation/ + - /services/vision/segmentation/ + - /ml/vision/ + - /appendix/apis/services/vision/ + - /operate/reference/services/vision/ icon: true images: ["/services/icons/vision.svg"] tags: ["vision", "computer vision", "CV", "services"] diff --git a/docs/operate/reference/services/vision/_index.md b/docs/operate/reference/services/vision/_index.md deleted file mode 100644 index 5fab94eeec..0000000000 --- a/docs/operate/reference/services/vision/_index.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: "Vision Service" -linkTitle: "Vision Service" -weight: 20 -type: "docs" -description: "The vision service enables your machine to use its on-board cameras to intelligently see and interpret the world around it." -icon: true -images: ["/services/icons/vision.svg"] -tags: ["vision", "computer vision", "CV", "services"] -no_list: true -modulescript: true -hide_children: true -aliases: - - "/services/vision/" - - "/ml/vision/detection/" - - "/ml/vision/classification/" - - "/ml/vision/segmentation/" - - "/services/vision/segmentation/" - - /ml/vision/ -date: "2022-01-01" -# updated: "" # When the content was last entirely checked -# SMEs: Bijan, Khari -toc_hide: true ---- diff --git a/docs/operate/reference/services/vision/color_detector.md b/docs/operate/reference/services/vision/color_detector.md deleted file mode 100644 index 74d42e0ea3..0000000000 --- a/docs/operate/reference/services/vision/color_detector.md +++ /dev/null @@ -1,340 +0,0 @@ ---- -title: "Configure a color_detector" -linkTitle: "color_detector" -weight: 10 -type: "docs" -description: "A heuristic detector that draws boxes around objects according to their hue (does not detect black, gray, and white)." -service_description: "A heuristic detector that draws boxes around objects according to their hue (does not detect black, gray, and white)." -tags: ["vision", "computer vision", "CV", "services", "detection"] -images: ["/services/vision/dog-detector.png"] -aliases: - - /services/vision/detection/ - - /services/vision/classification/ - - /ml/vision/color_detector/ - - /services/vision/color_detector/ - - /data-ai/services/vision/color_detector/ -# SMEs: Bijan, Khari ---- - -The `color_detector` vision service model is a heuristic detector that draws boxes around objects according to their hue. -Color detectors do not detect black, perfect grays (grays where the red, green, and blue color component values are equal), or white. -It only detects hues found on the color wheel. - -{{% alert title="Tip" color="tip" %}} -Object colors can vary dramatically based on the light source. -We recommend you verify the desired color detection value under actual lighting conditions. -To determine the color value from the actual camera component image, you can use a pixel color tool, like [Color Picker for Chrome](https://chrome.google.com/webstore/detail/color-picker-for-chrome/clldacgmdnnanihiibdgemajcfkmfhia). - -If the color is not reliably detected, increase the `hue_tolerance_pct`. -{{< /alert >}} - -{{< tabs >}} -{{% tab name="Builder" %}} - -Navigate to the **CONFIGURE** tab of your machine's page in the [Viam app](https://app.viam.com). -Click the **+** icon next to your machine part in the left-hand menu and select **Service**. -Select the `vision` type, then select the `color detector` model. -Enter a name or use the suggested name for your service and click **Create**. - -In your vision service's panel, select the color your vision service will be detecting, as well as a hue tolerance and a segment size (in pixels): - -![Color detector panel with color and hue tolerance selection and a field for the segment size](/services/vision/color-detector-panel.png) - -{{% /tab %}} -{{% tab name="JSON Template" %}} - -Add the vision service object to the services array in your JSON configuration: - -```json {class="line-numbers linkable-line-numbers"} -"services": [ - { - "name": "", - "type": "vision", - "model": "color_detector", - "attributes": { - "segment_size_px": , - "detect_color": "#ABCDEF", - "hue_tolerance_pct": , - "saturation_cutoff_pct": , - "value_cutoff_pct": - } - }, - ... // Other services -] -``` - -{{% /tab %}} -{{% tab name="JSON Example" %}} - -```json {class="line-numbers linkable-line-numbers"} -"services": [ - { - "name": "blue_square", - "type": "vision", - "model": "color_detector", - "attributes": { - "segment_size_px": 100, - "detect_color": "#1C4599", - "hue_tolerance_pct": 0.07, - "value_cutoff_pct": 0.15 - } - }, - { - "name": "green_triangle", - "type": "vision", - "model": "color_detector", - "attributes": { - "segment_size_px": 200, - "detect_color": "#62963F", - "hue_tolerance_pct": 0.05, - "value_cutoff_pct": 0.20 - } - } -] -``` - -{{% /tab %}} -{{< /tabs >}} - -The following parameters are available for a `color_detector`: - - -| Parameter | Required? | Description | -| --------- | --------- | ----------- | -| `segment_size_px` | **Required** | An integer that sets a minimum size (in pixels) of a contiguous color region to be detected, and filters out all other found objects below that size. | -| `detect_color` | **Required** | The color to detect in the image, as a string of the form `#RRGGBB`. The color is written as a hexadecimal string prefixed by ‘#’. | -| `hue_tolerance_pct` | **Required** | A number bigger than 0.0 and smaller than or equal to 1.0 that defines how strictly the detector must match to the hue of the color requested. ~0.0 means the color must match exactly, while 1.0 matches to every color, regardless of the input color. 0.05 is a good starting value. | -| `saturation_cutoff_pct` | Optional | A number > 0.0 and <= 1.0 which defines the minimum saturation before a color is ignored. Defaults to 0.2. | -| `value_cutoff_pct` | Optional | A number > 0.0 and <= 1.0 which defines the minimum value before a color is ignored. Defaults to 0.3. | - -{{% alert title="Info" color="info" %}} - -**hue_tolerance_pct**, **saturation_cutoff_pct**, and **value_cutoff_pct** refer to hue, saturation, and value (brightness) in the HSV Color Model, but do not set color values in Viam. - -**hue_tolerance_pct** specifies the exactness of the color match to **detect_color**. - -The optional **saturation_cutoff_pct** and **value_cutoff_pct** attributes specify cutoff thresholds levels for saturation and brightness, rather than specifying color saturation and brightness as they do in the standard HSV Color Model. - -{{% /alert %}} - -Click the **Save** button in the top right corner of the page. -Proceed to [test your detector](#test-your-detector). - -## Test your detector - -You can test your detector with [live camera footage](#live-camera-footage) or [existing images](#existing-images). - -### Live camera footage - -1. Configure a [camera component](/operate/reference/components/camera/). - {{< alert title="Tip" color="tip" >}} - This is the camera whose name you need to pass to vision service methods. - {{< /alert >}} -2. After adding the camera, click the **Save** button in the top right corner of the page. -3. Click on the **Test** area on the vision service configuration panel, or navigate to the **CONTROL** tab, click on the vision service and select your camera and vision service and then click **Refresh**. - The panel will show detections with confidence above the `default_minimum_confidence` with bounding boxes on the image. - - ![Blue boxes detected](/services/vision/detections.png) - -{{% expand "Click to see how to configure a camera live feed that shows detections or classifications" %}} - -Configure a [transform camera](/operate/reference/components/camera/transform/) with the following attributes: - -```json -{ - "pipeline": [ - { - "type": "detections", - "attributes": { - "confidence_threshold": 0.5, - "detector_name": "", - "valid_labels": ["