Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/florianmgs/gpt4-image-api
Small tool using selenium to get a temporary API endpoint for the ChatGPT Image Input / image recognition feature. Very quickly made, you should not rely on this on prod.
https://github.com/florianmgs/gpt4-image-api
api chatgpt fastapi gpt4 gpt4-api image openai python selenium
Last synced: 3 months ago
JSON representation
Small tool using selenium to get a temporary API endpoint for the ChatGPT Image Input / image recognition feature. Very quickly made, you should not rely on this on prod.
- Host: GitHub
- URL: https://github.com/florianmgs/gpt4-image-api
- Owner: FlorianMgs
- Created: 2023-10-03T12:04:54.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-10-09T15:13:57.000Z (over 1 year ago)
- Last Synced: 2023-10-09T16:38:40.220Z (over 1 year ago)
- Topics: api, chatgpt, fastapi, gpt4, gpt4-api, image, openai, python, selenium
- Language: Python
- Homepage:
- Size: 5.86 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GPT4 Image Recognition API
Small tool using selenium to get a temporary API endpoint for the ChatGPT Image Input / image recognition feature.
Very quickly made, you should not rely on this on prod.
Should be deprecated as soon as we have access to official OpenAI endpoints.
Works with google authentification. If you use a different login method, please modify the code for your usecase.# Installation
- Create venv, then clone the repo
- Install requirements:
`pip install -r requirements.txt`
- Define a `.env` file with your OpenAI Google credentials (or whatever but make sure to modiy the code appropriately)
- Run FastAPI server:
`python main.py`# Endpoints
## GET
`https://0.0.0.0:8000/start`
Start a new session. Complete manually the login steps and press enter when asked.
Wait for the OpenAI popup to display before pressing enter.`https://0.0.0.0:8000/stop`
Stop the current session.## POST
`https://0.0.0.0:8000/action/`
Post an image URL with a prompt. Example:
```
Request:
{
"image_url": "https://www.reuters.com/resizer/NLk9k89J1tfmH-B7XKd598-6j_Y=/960x0/filters:quality(80)/cloudfront-us-east-2.images.arcpublishing.com/reuters/AHF2FYISNJO55J6N35YJBZ2JYY.jpg",
"prompt": "Describe this image precisely."
}Response:
{
"status": "Success",
"result": {
"answer": "A night view of the Eiffel Tower illuminated, with its reflection visible in calm water in the foreground. The sky is dark blue, and there are two streetlights on either side of the scene."
}
}
```