-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat: add object detection (android) #52
Conversation
2b122ad
to
4b93b7c
Compare
c0e021e
to
e653737
Compare
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.
@jakmro something doesn't look right here, can you revert your last changes?
4b93b7c
to
2c79aea
Compare
{detections.map((detection, index) => { | ||
const { scaleX, scaleY, offsetX, offsetY } = | ||
calculateAdjustedDimensions(); | ||
const { x1, y1, x2, y2 } = detection.bbox; | ||
|
||
const left = x1 * scaleX + offsetX; | ||
const top = y1 * scaleY + offsetY; | ||
const width = (x2 - x1) * scaleX; | ||
const height = (y2 - y1) * scaleY; | ||
|
||
return ( | ||
<View | ||
key={index} | ||
style={[ | ||
styles.bbox, | ||
{ left, top, width, height, borderColor: 'red' }, | ||
]} | ||
> | ||
<Text style={styles.label}> | ||
{detection.label} ({(detection.score * 100).toFixed(1)}%) | ||
</Text> | ||
</View> | ||
); | ||
})} |
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.
In the future/in spare time would be nice to extract it into separete component (possibly in another file)
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'll add a task for that :D
Description
Type of change
Tested on
Testing instructions
Screenshots
Related issues
Checklist
Additional notes