AI Cooking Coach is a Python application that uses Google's Gemini Pro Vision to analyze your cooking videos and provide step-by-step feedback, just like a personal cooking instructor. It generates a new video with feedback overlaid directly on your original footage.
- AI-Powered Analysis: Leverages the Gemini API's multimodal capabilities to understand and comment on cooking techniques shown in a video.
- Customizable Persona: Choose your coach's style—from Gordon Ramsay's tough love to Julia Child's encouragement—by editing the prompt.
- Video Feedback Overlay: Feedback appears at the precise moments actions occur in your video.
- Audio Preservation: The original audio is included in the final output.
- Secure & Structured: API keys are managed securely using environment variables.
- The script sends your video and a detailed prompt to the Gemini API.
- The AI analyzes the video and returns a structured JSON file with timestamped feedback.
Sample Output:
{
"analysis": [
{
"timestamp": "00:14-00:15",
"action": "Cracking eggs",
"feedback": "Technique is acceptable, but lacks precision. Crack the eggs on a flat surface to avoid shell fragments."
},
{
"timestamp": "00:16-00:18",
"action": "Seasoning",
"feedback": "Good amount of salt and pepper, but seasoning before whisking can make the eggs watery. It's better to season in the pan."
}
],
"summary": {
"title": "Analysis of My Cooking",
"overall_feedback": "A solid attempt. Your fundamentals are there, but focus on refining your technique for a more professional result. Pay attention to heat management and the timing of your seasoning."
}
}- Reads the generated JSON and original video.
- Uses OpenCV to draw feedback text onto each frame at the correct timestamp.
- Uses moviepy to combine the new video track with the original audio.
- "Technique is acceptable, but lacks precision. Crack the eggs on a flat surface to avoid shell fragments."
- "Good amount of salt and pepper, but seasoning before whisking can make the eggs watery. It's better to season in the pan."
git clone <your-repo-url>
cd ai-cooking-coachFor Mac/Linux:
python3 -m venv venv
source venv/bin/activateFor Windows:
python -m venv venv
.\venv\Scripts\activatepip install -r requirements.txt- Create a file named
.envin the root directory. - Add your API key:
GEMINI_API_KEY="YOUR_API_KEY_HERE"
- The
.gitignoreis already configured to keep this file private.
- Place your video: Put the cooking video you want to analyze into the
videos/input/directory. - Run the main script:
python main.py "videos/input/your_video_name.mp4" - Check the output:
- The AI's analysis will be saved as a JSON file in the
analysis_results/folder. - The final video with feedback overlay will be saved in the
videos/output/folder.
- The AI's analysis will be saved as a JSON file in the
This project is licensed under the MIT License. See the LICENSE file for details.
Build your own AI-powered cooking coach or integrate it into your product!

