Skip to content

Commit

Permalink
DOCS-2644: Address Alyssa's feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
npentrel committed Jul 18, 2024
1 parent bc85e10 commit 6346d95
Showing 1 changed file with 34 additions and 7 deletions.
41 changes: 34 additions & 7 deletions docs/use-cases/image-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ From there, you can use your image data to do things like [train ML models](/use

{{< /alert >}}

In the next how-to guide you can use the images you collect here to [train computer vision models](/use-cases/deploy-ml/).
If you'd like to follow a more detailed tutorial, see [Selectively Capture Data Using filtered-camera](/tutorials/projects/filtered-camera/).

## Prerequisites

Expand All @@ -42,7 +42,8 @@ In the next how-to guide you can use the images you collect here to [train compu
{{<imgproc src="/icons/components/camera.svg" class="fill alignleft" style="max-width: 150px" declaredimensions=true alt="configure a camera component">}}
**1. Configure a camera**

Configure a camera component, such as a [webcam](/components/camera/webcam/), on your machine.
On your [machine's page](#prerequisites), configure any camera component.
If you are nor sure what to use, start with a [webcam](/components/camera/webcam/).

{{% /tablestep %}}
{{% tablestep link="/services/data/"%}}
Expand All @@ -69,18 +70,28 @@ For example, set it to `0.05` to capture an image every 20 seconds.

Set the MIME type to your desired image format, for example `image/jpeg`.

**Click save to start capturing data.**

{{% /tablestep %}}
{{% tablestep %}}
{{<imgproc src="/services/ml/collect.svg" class="fill alignleft" style="max-width: 150px" declaredimensions=true alt="Train models">}}
**4. View data in the Viam app**

{{< alert title="Wait until data appears" color="note" >}}
Your data will sync at the specified sync interval, which may mean you have to wait for data to appear.

If no data appears after the sync interval, check the [**Logs**](/cloud/machines/#logs).
{{< /alert >}}

Once you have synced images, you can [view those images in the Viam app](/services/data/view/) from the **DATA** tab in the top navigation bar.

You can also [export your data from the Viam app](/services/data/export/) to a deployed machine, or to any computer.

{{% /tablestep %}}
{{< /table >}}

If this is not a production machine and you have confirmed that your machine is capturing and syncing data, disable data capture in the camera configuration to avoid capturing large amounts of unneeded data.

## Use filtering to collect and sync only certain images

You can use filtering to selectively capture images using a machine learning (ML) model, for example to only capture images with people in them.
Expand All @@ -95,7 +106,8 @@ The following steps use the [`filtered_camera`](https://github.com/erh/filtered_

Configure an ML model service on your machine that is compatible with the ML model you want to use, for example [TFLite CPU](/services/ml/deploy/tflite_cpu/).

From the **Model** dropdown, select the preexisting model you want to use, or click **Add new model** to upload your own.
From the **Model** dropdown, select an [existing model](https://app.viam.com/registry?type=ML+Model) you want to use, or click **Add new model** to upload your own.
If you're not sure which model to add, you can add [`EfficientNet-ImageNet2012`](https://app.viam.com/ml-model/viam/EfficientNet-ImageNet2012) which can detect people and animals, among other things.

{{% /tablestep %}}
{{% tablestep link="/services/vision/"%}}
Expand All @@ -114,22 +126,37 @@ From the **Select model** dropdown, select the name of your ML model service (fo

The `filtered-camera` {{< glossary_tooltip term_id="modular-resource" text="modular component" >}} pulls the stream of images from the camera you configured earlier, and applies the vision service to it.

Configure a `filtered-camera` component on your machine, following the [attribute guide in the README](https://github.com/erh/filtered_camera?tab=readme-ov-file#configure-your-filtered-camera) to specify the names of your webcam and vision service, and add classification and object detection filters.
Configure a `filtered-camera` component on your machine, following the [attribute guide in the README](https://github.com/erh/filtered_camera?tab=readme-ov-file#configure-your-filtered-camera) to specify the names of your camera and vision service, and add classification and object detection filters.

{{% /tablestep %}}
{{% tablestep %}}
{{<imgproc src="/services/icons/data-capture.svg" class="fill alignleft" style="max-width: 150px" declaredimensions=true alt="Train models">}}
**4. Configure data capture and sync on the filtered camera**

Configure data capture and sync just as you would for a webcam.
Configure data capture and sync just as you did before.
The filtered camera will only capture image data that passes the filters you configured in the previous step.

Turn off data capture on your webcam if you haven't already, so that you don't capture duplicate or unfiltered images.
Turn off data capture on your camera if you haven't already, so that you don't capture duplicate or unfiltered images.

{{% /tablestep %}}
{{% tablestep %}}

{{<imgproc src="/services/ml/collect.svg" class="fill alignleft" style="max-width: 150px" declaredimensions=true alt="Train models">}}
**5. View filtered data in the Viam app**

Once you save your configuration, your filtered images will sync and you can [view those images in the Viam app](/services/data/view/) from the **DATA** tab.

{{< alert title="Wait until data appears" color="note" >}}
Your data will sync at the specified sync interval, which may mean you have to wait for data to appear.

If no data appears after the sync interval, check the [**Logs**](/cloud/machines/#logs) and ensure that the condition for filtering is met.
You can add a [`transform` camera](/components/camera/transform/) to see detections or classifications live from the [**CONTROL** tab](/cloud/machines/#control).
{{< /alert >}}

{{% /tablestep %}}
{{% tablestep %}}
{{<imgproc src="/services/ml/configure.svg" class="fill alignleft" style="max-width: 150px" declaredimensions=true alt="Train models">}}
**5. (Optional) Trigger sync with custom logic**
**6. (Optional) Trigger sync with custom logic**

By default, the captured data syncs at the regular interval you specified in the data capture config.
If you need to trigger sync in a different way, see [Trigger cloud sync conditionally](/services/data/trigger-sync/) for a documented example of syncing data only at certain times of day.
Expand Down

0 comments on commit 6346d95

Please sign in to comment.