Skip to content

Conversation

@tahiyasalam
Copy link
Member

@tahiyasalam tahiyasalam commented Nov 10, 2025

Context

This PR uses the to-be-added annotations field in the Image proto message to allow filtered camera modules used for Kongsberg to attach tags and their scores to data marked for upload, which is currently not possible.

Testing

  • Unit tests modified
  • Locally testing using modified RDK and filtered_camera module (see scope)

@viambot viambot added the safe to test This pull request is marked safe to test from a trusted zone label Nov 10, 2025
@github-actions
Copy link
Contributor

Warning your change may break code samples. If your change modifies any of the following functions please contact @viamrobotics/fleet-management. Thanks!

component function
base IsMoving
button Push
genericcomponent DoCommand
board GPIOPinByName
camera Properties
encoder Properties
motor IsMoving
sensor Readings
servo Position
arm EndPosition
audio MediaProperties
gantry Lengths
gripper IsMoving
input_controller Controls
movement_sensor LinearAcceleration
power_sensor Power
pose_tracker Poses
genericservice DoCommand
motion GetPose
vision GetProperties

@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Nov 10, 2025
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Nov 10, 2025
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Nov 10, 2025
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Nov 11, 2025
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Nov 11, 2025
@tahiyasalam tahiyasalam changed the title Add logic for passing through annotations APP-10189 - Add logic for passing through annotations from Images Nov 11, 2025
return res, data.NewFailedToReadError(params.ComponentName, getImages.String(), err)
}
annotations := img.Annotations()
annotations.Classifications = append(annotations.Classifications, data.Classification{Label: img.SourceName})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we document anywhere that things are automatically tagged with the images source name?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure, maybe someone on data team can chime in

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point, im not sure if we do! i can file a ticket for the docs team

golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c
)

replace go.viam.com/api => github.com/viamrobotics/api v0.1.488-0.20251110195528-f9899c831ae4 //APP-10190
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A reminder to merge latest before merging this.

Copy link
Member

@etai-shuchatowitz etai-shuchatowitz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Just might wanna have someone with more knowledge on this to take a peek.


// ImageMetadata contains useful information about returned image bytes such as its mimetype.
// Annotations returns the annotations of the NamedImage.
func (ni *NamedImage) Annotations() data.Annotations {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any scenarios where RDK may want to set annotations after initialization?

test.That(t, len(imgs), test.ShouldEqual, 1)
test.That(t, imgs[0].SourceName, test.ShouldEqual, source2Name)
test.That(t, imgs[0].MimeType(), test.ShouldEqual, rutils.MimeTypeRawDepth)
test.That(t, imgs[0].Annotations(), test.ShouldResemble, annotations2)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curious why resemble?

bc it's deep value equality not pointer equality?

}

var bboxes []BoundingBox
for _, bb := range protoAnnotations.Bboxes {
Copy link
Member

@hexbabe hexbabe Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

repeated message fields are *pb.Bbox right? so bb can be nil

}

var classifications []Classification
for _, c := range protoAnnotations.Classifications {
Copy link
Member

@hexbabe hexbabe Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

repeated message fields are *pb.Bbox right? so bb can be nil

same with c if the above is true

}
depth := rimage.NewEmptyDepthMap(10, 20)
depthImg, err := camera.NamedImageFromImage(depth, "depth", utils.MimeTypeRawDepth)
depthImg, err := camera.NamedImageFromImage(depth, "depth", utils.MimeTypeRawDepth, annotations2)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

surprised there are no assertions in this file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test This pull request is marked safe to test from a trusted zone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants