-
Notifications
You must be signed in to change notification settings - Fork 74
feat: port image segmentation native code to C++ #313
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
Merged
JakubGonera
merged 9 commits into
@jakubgonera/cpp
from
@jakubgonera/segmentation_cherry_pick
May 27, 2025
Merged
Changes from 5 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
f04b70d
feat: port image segmentation to C++
JakubGonera fae566f
fix: add missing include
JakubGonera 5669014
fix: adapt segmentation for refactored promises
JakubGonera 8898150
fix: switch to callAsync for CallInvoker
JakubGonera 5363df4
fix: podfiles updated
JakubGonera 7d77c09
Update common/rnexecutorch/data_processing/Numerical.h
JakubGonera d640760
Update common/rnexecutorch/data_processing/Numerical.cpp
JakubGonera 20d6ed2
fix: assert input dimensions
JakubGonera 864ba8e
fix: input shape checking
JakubGonera File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
58 changes: 0 additions & 58 deletions
58
android/src/main/java/com/swmansion/rnexecutorch/ImageSegmentation.kt
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 0 additions & 26 deletions
26
android/src/main/java/com/swmansion/rnexecutorch/models/imageSegmentation/Constants.kt
This file was deleted.
Oops, something went wrong.
139 changes: 0 additions & 139 deletions
139
...c/main/java/com/swmansion/rnexecutorch/models/imageSegmentation/ImageSegmentationModel.kt
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| #include "Numerical.h" | ||
|
|
||
| #include <algorithm> | ||
| #include <numeric> | ||
|
|
||
| namespace rnexecutorch::numerical { | ||
| void softmax(std::vector<float> &v) { | ||
| float max = *std::max_element(v.begin(), v.end()); | ||
|
|
||
| for (float &x : v) { | ||
| x = std::exp(x - max); | ||
| } | ||
| float sum = std::accumulate(v.begin(), v.end(), 0.f); | ||
| for (float &x : v) { | ||
| x /= sum; | ||
| } | ||
| } | ||
| } // namespace rnexecutorch::numerical | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| #pragma once | ||
|
|
||
| #include <vector> | ||
|
|
||
| namespace rnexecutorch::numerical { | ||
| void softmax(std::vector<float> &v); | ||
| } | ||
|
JakubGonera marked this conversation as resolved.
Outdated
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.