-
Notifications
You must be signed in to change notification settings - Fork 114
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
Conversation
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.
just one small repeated function, otherwise all of this looks good!
services/vision/mlvision/detector.go
Outdated
func GetIndex(s []int, num int) int { | ||
for i, v := range s { | ||
if v == num { | ||
return i | ||
} | ||
} | ||
return -1 | ||
} |
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.
This is repeated from the new ml/ml.go function GetIndex, would you remove this one and use that one from ml package?
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.
Yes! all set
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.
Thanks! Once the tests pass too, this looks good to go
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)

