Skip to content

Commit 98c708c

Browse files
authored
Update image retrieval to get multiple images (#1051)
1 parent 2d07455 commit 98c708c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/viam/services/vision/vision.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,8 @@ async def get_detections(
168168
my_detector = VisionClient.from_robot(robot=machine, "my_detector")
169169
170170
# Get an image from the camera
171-
img = await my_camera.get_image()
171+
images, _ = await my_camera.get_images()
172+
img = images[0]
172173
173174
# Get detections for that image
174175
detections = await my_detector.get_detections(img)
@@ -235,7 +236,8 @@ async def get_classifications(
235236
my_classifier = VisionClient.from_robot(robot=machine, "my_classifier")
236237
237238
# Get an image from the camera
238-
img = await my_camera.get_image()
239+
images, _ = await my_camera.get_images()
240+
img = images[0]
239241
240242
# Get the 2 classifications with the highest confidence scores for the image
241243
classifications = await my_classifier.get_classifications(img, 2)

0 commit comments

Comments
 (0)