Skip to content

Commit

Permalink
DOCS-2714: Update example for image data (#725)
Browse files Browse the repository at this point in the history
  • Loading branch information
npentrel committed Sep 12, 2024
1 parent 86836e1 commit 599f67e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/viam/app/data_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,10 @@ async def binary_data_by_filter(
::
from viam.utils import create_filter
from viam.proto.app.data import Filter, TagsFilter, TagsFilterType
# Get data captured from camera components
my_data = []
last = None
my_filter = create_filter(component_name="camera")
Expand All @@ -326,6 +328,23 @@ async def binary_data_by_filter(
break
my_data.extend(data)
# Get untagged data from a dataset
my_untagged_data = []
last = None
tags_filter = TagsFilter(type=TagsFilterType.TAGS_FILTER_TYPE_UNTAGGED)
my_filter = Filter(
dataset_id="66db6fe7d93d1ade24cd1dc3",
tags_filter=tags_filter
)
while True:
data, count, last = await data_client.binary_data_by_filter(
my_filter, last=last, include_binary_data=False)
if not data:
break
my_untagged_data.extend(data)
Args:
filter (viam.proto.app.data.Filter): Optional `Filter` specifying tabular data to retrieve. No `Filter` implies all binary
data.
Expand Down

0 comments on commit 599f67e

Please sign in to comment.