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

feat: add object detection (android) #52

Merged
merged 7 commits into from
Dec 17, 2024
Merged

Conversation

chmjkb
Copy link
Contributor

@chmjkb chmjkb commented Dec 14, 2024

Description

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update (improves or adds clarity to existing documentation)

Tested on

  • iOS
  • Android

Testing instructions

Screenshots

Related issues

Checklist

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly
  • My changes generate no new warnings

Additional notes

@chmjkb chmjkb marked this pull request as draft December 14, 2024 12:02
@chmjkb chmjkb changed the title @chmjkb/object detection android feat: add object detection (android) Dec 14, 2024
@chmjkb chmjkb changed the base branch from main to @jakmro/classification-android December 16, 2024 15:12
@chmjkb chmjkb marked this pull request as ready for review December 16, 2024 15:18
@chmjkb chmjkb force-pushed the @chmjkb/object-detection-android branch from 2b122ad to 4b93b7c Compare December 16, 2024 15:22
@chmjkb chmjkb requested a review from mkopcins December 16, 2024 15:23
@jakmro jakmro force-pushed the @jakmro/classification-android branch from c0e021e to e653737 Compare December 16, 2024 19:05
Copy link
Collaborator

@mkopcins mkopcins left a 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?

@mkopcins mkopcins changed the base branch from @jakmro/classification-android to main December 16, 2024 22:09
@chmjkb chmjkb force-pushed the @chmjkb/object-detection-android branch from 4b93b7c to 2c79aea Compare December 17, 2024 08:37
Comment on lines +60 to +83
{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>
);
})}
Copy link
Collaborator

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)

Copy link
Contributor Author

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

@chmjkb chmjkb merged commit 1499364 into main Dec 17, 2024
2 checks passed
@chmjkb chmjkb deleted the @chmjkb/object-detection-android branch December 17, 2024 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants