Locguessr
Location guessing from picture
Install / Use
/learn @Joabutt/LocguessrREADME
LocGuessr 📍
A location guessing website powered by OpenAI's GPT-4 Vision. This is a simple proof of concept about the capabilities of the new OpenAI GPT-4 Vision model. The aim is to guess the location of an image using the power of advanced AI. The counter is reset daily to limit the number of times the image search can be queried.
Project Structure
The main files in this project are:
- The
index.html, which contains the main User Interface layout and interactivity mostly written in Vanilla JS, HTML and CSS. index.js, a Node.js backend that interfaces with several APIs like Firebase for the realtime database counter (remove from your local copy if needed), and OpenAI's GPT-4-Vision.
Tech Stack
- Front-end: HTML, CSS, JavaScript
- Back-end: Node.js with Express.js
- External APIs: OpenAI GPT-4 Vision API, imgbb Image Hosting API
- Deployment: Hosted on Cyclic
- Additional Node.js libraries: axios, body-parser, dotenv, express-fileupload and form-data
How to use
- On launching the application, you are presented with an interface where you can upload an image.
- Upon uploading an image, it is sent to the server for processing.
- GPT-4 vision analyses the uploaded image and makes an educated guess about where the image could be taken.
- The application displays the predicted location along with the relevant country flag.
Prerequisites
Ensure you have Node.js and npm/yarn installed. Also set up a Firebase Realtime database (if you want a counter) and Integrate your database and OpenAI GPT-4 Vision API with the application via environment variables.
How to setup locally
After cloning the repository,
- Install dependencies by running
npm install
or
yarn
- Copy the
.env.exampleto.envin the root of your project and insert your keys in this format:
OPENAI_API_KEY=<your_openai_key>
IMGBB_API_KEY=<your_imgbb_key>
RTDB_URL=<your_firebase_realtime_database_url>
The database URL is the URL of your Firebase Realtime Database, and the keys are your respective OpenAI and Imgbb API keys.
-
Set up Firebase Admin SDK private key file on project root and ensure the relative path to the
.jsonfile is correctly referenced inindex.js. -
Run the app:
node index.js
The application serves static files from the root directory and runs on port 5000. You can access locally with http://localhost:5000
Note: This project resets the counter for queries everyday. Be sure to check your OpenAI GPT-4 Vision API usage to avoid surpassing quota.
Contributing
Any contributions are welcome! Please check our contributing guide for further details.
Support this project
Give this repository a ⭐ if it helped you!
Related Skills
node-connect
344.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
99.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
344.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
344.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
