| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
| } | ||
| } | ||
|
|
||
| fun Bitmap.saveImage(context: Context): Uri? { |
There was a problem hiding this comment.
Long term will just overwrite the saved image, but for now i wanna compare
Sorry, something went wrong.
|
|
||
| class ImageSegmenterHelper( | ||
| var currentDelegate: Int = DELEGATE_CPU, | ||
| var runningMode: RunningMode = RunningMode.IMAGE, |
There was a problem hiding this comment.
Can set it to process on a live stream instead of images. I wonder if this will be preferable, performance wise, for the live view & how that would tie into the current plugin model?
Sorry, something went wrong.
- Old approach blurred the whole image & then applied the mask which is significantly more computationally expensive - Also fixing some lint errors
|
Newly optimised blurring algo takes roughly 700ms on pixel 6a with a large radius of 25 (not including segmentation). Defo further optimisations to be had. Will focus next on shoving it on a background thread & improving the smoothness of the blur |
Sorry, something went wrong.
Also not 100% happy with the visuals of the blur, but can polish this later after getting the images to save in the correct orientation :D |
Sorry, something went wrong.
- Remove some redundant code - General refactoring for readability
| stoneCameraViewModel: StoneCameraViewModel, | ||
| outputFileResults: ImageCapture.OutputFileResults | ||
| ) { | ||
| val portraitModeSetting = stoneCameraViewModel.getSetting<String>("portraitMode") ?: "OFF" |
There was a problem hiding this comment.
Do you think we should do this on a "mode" basis?
E.g. extend the Photo Mode plugin? Then there will be a mode option like most other camera apps?
Sorry, something went wrong.
There was a problem hiding this comment.
Yeah I think this would be a good idea. Will make that change
Sorry, something went wrong.
| private fun getOriginalImageRotation(contentResolver: ContentResolver, imageUri: Uri): Int { | ||
| val exifInputStream = contentResolver.openInputStream(imageUri) | ||
| val exif = ExifInterface(exifInputStream!!) | ||
| val rotation = when (exif.getAttributeInt( |
There was a problem hiding this comment.
Should this be more global for all modes? Perhaps I'm mis-understanding
Sorry, something went wrong.
There was a problem hiding this comment.
The image was being spat out sideways after blurring for some reason. No objection to making it more global
Sorry, something went wrong.
| ) | ||
| } | ||
|
|
||
| // Stolen from https://stackoverflow.com/questions/21418892/understanding-super-fast-blur-algorithm?fbclid=IwZXh0bgNhZW0CMTEAAR1w91ucNtw4nU-Z8Z9RyMYFVUHWxfgt7ivsE7foTkwR2wmdx2losQqQ0sk_aem_Zrf_8344PRxW6SFzutkE7g |
There was a problem hiding this comment.
"Borrowed from" 😉
Sorry, something went wrong.
There was a problem hiding this comment.
Also, isn't there a way we can shift this onto a shader?
Sorry, something went wrong.
There was a problem hiding this comment.
Not aware of shaders. will take a look
Sorry, something went wrong.
| import com.google.mediapipe.tasks.vision.imagesegmenter.ImageSegmenterResult | ||
|
|
||
| class ImageSegmenterHelper( | ||
| var currentDelegate: Int = DELEGATE_CPU, |
There was a problem hiding this comment.
Can we make sure we use GPU where possible?
Sorry, something went wrong.
There was a problem hiding this comment.
I was having trouble w/ gpu but yes, I agree. Will work on making that happen
Sorry, something went wrong.
| } | ||
| } | ||
|
|
||
| when(currentModel) { |
There was a problem hiding this comment.
Are all the models included in the build at this stage? How do we strip out the ones we're not using?
Sorry, something went wrong.
There was a problem hiding this comment.
They are not, have made changes to remove references to other models
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Portrait mode with MediaPipe.