flutterfire
flutterfire copied to clipboard
Poor image analysis with liveGenerativeModel
Is there an existing issue for this?
- [x] I have searched the existing issues.
Which plugins are affected?
Other
Which platforms are affected?
Windows
Description
Using the flutterfire sdk for gemini ai in a flutter application.
With a regular call to gemini ai model = FirebaseAI.googleAI().generativeModel(model: 'gemini-2.5-flash'); and with a screenshot of my desktop and recorded audio instructions (“list the names of the chat rooms visible on my screen” or “what is the name of the app that is being developed in visual studio code on my screen”, gemini provides accurate answers.
However, when using the live api liveModel => FirebaseAI.googleAI().liveGenerativeModel(model: 'gemini-live-2.5-flash-preview'), with the same instructions and prompts, the responses are completely incorrect. Sometimes they seem hallucinated with no basis in the image, sometimes there are correct portions intermingled with others. The live api has my screenshot and can identify which apps are in which portions of my screen, although it has incorrectly identified which IDE and messaging apps I am using at times.
I am sending the same screenshot data to each model and preview that data to know that it is a high quality image.
It seems that somewhere along the live api processing, the image gets significantly distorted and text recognition becomes near impossible.
Reproducing the issue
Initialize a model and send a screenshot with either generativeModel or liveGenerativeModel and ask questions about the screenshot. The liveGenerativeModel has significant inaccuracies not present in the normal model.
Firebase Core version
2.27.0
Flutter Version
3.19.0
Relevant Log Output
Flutter dependencies
Expand Flutter dependencies snippet
Replace this line with the contents of your `flutter pub deps -- --style=compact`.
Additional context and comments
No response