This app uses the Frame AR device to capture images and translate text using OpenAI's Vision API. This prototype was put together at Side Project Saturday.
- Tap-to-Translate: Simply tap the side of Frame to capture an image
- Automatically sends the image to OpenAI's Vision API
- Displays the translation on the Frame display
- Supports any languages OpenAI can recognize and translate
- Brilliant Labs Frame AR device
- Mise
- OpenAI API key
- Clone this repository
- Install the required packages:
mise install- Set up your OpenAI API key as an environment variable:
export OPENAI_API_KEY=your_api_key_here- Connect your Frame device via Bluetooth.
- Run the application:
mise run translate- Once the app is running, you'll see "Tap to translate" on the Frame display.
- Tap on the side of the Frame when pointing at text you want to translate.
- The Frame will show a brief flash to confirm the tap was detected
- "Taking photo..." will display while capturing
- "Processing..." will display while the image is being analyzed
- The translation result will appear on the Frame display.
- Tap again to translate something else.
The app consists of two parts:
-
Frame app (Lua) (lua/translate_app.lua):
- Handles tap detection using Frame's IMU (motion sensor)
- Captures photos when a tap is detected
- Displays text and status messages
-
Host app (Python) (translator.py):
- Manages communication with Frame
- Processes photos captured by taps
- Sends images to OpenAI with translation prompt
- Returns translation results to Frame
If the app doesn't respond to taps:
- Make sure to tap firmly on the side of Frame
- Try tapping at different locations along the edge
- Check the console output for "Tap detected!" messages
- Restart the app if tap detection stops working
- Make sure your OpenAI API key is correctly set
- If translations fail, check your internet connection
- Ensure Frame is charged and connected via Bluetooth
- For better results, aim the Frame camera directly at clear, legible text
- Check the output images in the
capturesdirectory to make sure the text is legible.