-
Notifications
You must be signed in to change notification settings - Fork 126
APP-10189 - Add logic for passing through annotations from Images #5462
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Warning your change may break code samples. If your change modifies any of the following functions please contact @viamrobotics/fleet-management. Thanks!
|
| return res, data.NewFailedToReadError(params.ComponentName, getImages.String(), err) | ||
| } | ||
| annotations := img.Annotations() | ||
| annotations.Classifications = append(annotations.Classifications, data.Classification{Label: img.SourceName}) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
etai-shuchatowitz
left a comment
There was a problem hiding this 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 { |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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
Context
This PR uses the to-be-added
annotationsfield 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