-
Notifications
You must be signed in to change notification settings - Fork 765
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
Unable to Detect Poses on Recorded Video using InputImage.fromBytes() #628
Comments
Having the same issue. Apparently this is because the camera for some reason ignore your CameraController.imageFormatGroup setting when received images. And forced it back to YUV420 regardless of what camera image type you picked. I'm not sure if this is from Flutter (i just upgrade to 3.22), The package itself or the Camera package (they updated it a few days ago.) Edit : The workaround for now is converting your CameraImage from yuv420 to NV21.
Put it before you return InputImage.FromBytes like this
|
Relevant issue on the Flutter repo: flutter/flutter#145961 As of now, manually converting to NV21 or using the older camera plugin version 10.6 are the only options. |
Anyone. |
@famasf1 What is you _shouldReturnNull Function? Thanks for the Code! |
It's just a private function for my camera class that check whether the camera should return any value upon detection. If all values inside conditions block return true then execute It wasn't necessary, Most of the code is from this lib's example. I just abstract it because i don't like seeing a bunch of if scattering around (there are a lot of
It's crazy that this issues has been up for like 4 months now and there are still no fix in sight. |
@fbernaly Thanks for your reply! I think the process to change the ml kit package to the new image format isn't easy even though the android sdk supports YUV420 out of the box. To communicate the native part we have to format the YUV420 to json I guess and then we can send the image to the android sdk way. The flutter team isn't interested in supporting the nv21 format on the officelle camera package unfortunately. |
This issue is stale because it has been open for 30 days with no activity. |
This issue was closed because it has been inactive for 14 days since being marked as stale. |
It's worth noting that, As of 3 days ago with the new update from this plugin to version 0.11.1, My code above will not work and will result in error being thrown now.
I believed this is the related PR. given that the same error is being thrown for not satisfied correct image format. But i'm not sure either. since according to changelog. It simply 'Update Dependencies.' And didn't actually implementing this PR yet. Plus removing my converted code didn't fix anything. So it might be just CameraX being funny and that i should've picked the downgrading camera plugin method instead. The only fix i found is downgrade google_ml_kit_flutter. I'm using
solved my issue. If you didn't downgrade to camera: 0.10.6 yet and picking NV21 conversion method. Then please avoid updating google_ml_kit_flutter until further notice. |
@fbernaly Can you take a look on that? Thank You! |
Yeah same issue; I'm using google_mlkit_text_recognition 13.1, and trying to manually convert from Downgrading to The PR linked above is not related I don't think (it's been merged for a while). Even though you can pass It seems like the best fix would be to allow for converting a |
It's important to note that this is because Flutter Team out-of-the-blue decided to implemented CameraX into the library and replace the old implementation. I haven't downgrade Camera and stick with manually converting yuv_420_888 to NV21. and upgrading this lib will caused the error thrown now. Which didn't happened before on previous version. Downgrading Camera is probably the best solution now. |
when I was working on the latest changes, updating to the latest camera plugin breaks the example app, that is why the example app is still using I recommend you do not update to camera |
Google is planning to support nv21 for CameraX: flutter/flutter#145961 https://issuetracker.google.com/issues/359664078 But I don't know when this is planned. |
Poses are drawing on the live camera feed without an issue. But I want to draw poses on a recorded video. I can take snapshots of the video frames as bytes (Uint8List). Then what should I pass as
InputImageMetadata
. I tried pass default values similar to what is applied from the CameraImage to the InputImage during live camera in my device. Like below,But then I encounter the following error when process the image.
How can I use Uint8List to detect the poses. I did get the poses by using the
InputImage.fromFile
intead ofInputImage.fromBytes
. but saving Uint8List into a file take more time and not efficient. Can anyone suggest a solution for this.The text was updated successfully, but these errors were encountered: