First, the program gets the image(saved locally) called image.png, and prompts Google Bard to describe the image using it's image tools. This program uses the bardapi library, which allows you to prompt Bard for free.
The following instructions are applicable only to Windows
- Open a new terminal, and type
pip install bardapi - To check that it installed, type
bardapi --version
- Go to
bard.google.com - Open the
Devtools/Applicationtab - Go to
Storage/Cookies/https://bard.google.com - In the right panel, find
Secure 1-PSID - Copy the value and paste it into the token parameter for the
Bard()definition function
- Clear Browsing History for All Time
- Repeat the instructions above
- If it still doesn't work, generate the API key for a new account
The API keys are unique for each user, and often every session. Therefore, they have to often be regenerated. Different accounts will require you to regenerate the API key and repeat all the steps above.