Skip to content
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

DATA-3462 - Refactor code for using in Cloud inference #4792

Merged
merged 4 commits into from
Mar 6, 2025

Conversation

tahiyasalam
Copy link
Member

@tahiyasalam tahiyasalam commented Feb 13, 2025

Hi! This is another refactor that I had to put together in order to allow Cloud inference to have parity with the vision code. You'll notice that I changed the output response of the FormatDetection to be BoundingBoxes (with relative coordinates) that are then converted into Detections. This is to prevent information loss when switching from relative coordinates -> absolute coordinates -> relative coordinates in Cloud inference. Instead, we just return relative coordinates, which are used directly in Cloud inference, but then converted for the vision service.

I tested to make sure everything was running as intended using the EfficientDet-COCO TFLite module with stable RDK (top) and then with the new changes (bottom)
image
image

@tahiyasalam tahiyasalam changed the title DATA-3462 - Refactor code for using in app DATA-3462 - Refactor code for using in Cloud inference Feb 13, 2025
@viambot viambot added the safe to test This pull request is marked safe to test from a trusted zone label Feb 13, 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 Feb 25, 2025
@tahiyasalam tahiyasalam requested a review from bhaney February 25, 2025 14:23
Copy link
Member

@bhaney bhaney left a comment

Choose a reason for hiding this comment

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

just one small repeated function, otherwise all of this looks good!

Comment on lines 157 to 164
func GetIndex(s []int, num int) int {
for i, v := range s {
if v == num {
return i
}
}
return -1
}
Copy link
Member

@bhaney bhaney Feb 28, 2025

Choose a reason for hiding this comment

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

This is repeated from the new ml/ml.go function GetIndex, would you remove this one and use that one from ml package?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes! all set

@tahiyasalam tahiyasalam requested a review from bhaney March 5, 2025 16:32
@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 Mar 5, 2025
Copy link
Member

@bhaney bhaney left a comment

Choose a reason for hiding this comment

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

Thanks! Once the tests pass too, this looks good to go

@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 Mar 5, 2025
@tahiyasalam tahiyasalam merged commit 12939c4 into viamrobotics:main Mar 6, 2025
16 checks passed
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.

3 participants