🔥 Photo Calorie Tracker (image-calorie-tracker)
Recognizes food photos, logs daily calorie intake, and generates reports.
When to Run
- - The user sends food images
- The user asks about calories over the past X days (X is any number)
Workflow
Log Meals
- 1. Copy images to INLINECODE0
- Use the
image tool to recognize food - Estimate calories for each food item
- Update INLINECODE2
Generate Report
- 1. Read records for the target dates from INLINECODE3
- Read the target calories from INLINECODE4
- Output the report in the required format
Output Format
CODEBLOCK0
Status Rules
- - Incomplete: lunch or dinner is missing (breakfast does not count)
- {percent}%: difference between total calories and target; positive means over, negative means under
Meal Display Rules
- - Show only lunch, dinner, and snack (breakfast not counted)
- Omit meals that are not recorded
- Calorie unit: kcal
Meal Definitions
- - Lunch: around 12:00, about 300-800 kcal
- Dinner: around 18:00, about 400-1000 kcal
- Snack: snacks/desserts between lunch and dinner
Food Calorie Reference
| Category | Food | Calories (per 100g) |
|---|
| Staples | Rice | 130 kcal |
| Staples |
Mixed grain rice | 120 kcal |
| Meat | Fried chicken cutlet | 280 kcal |
| Meat | Stir-fried pork slices | 180 kcal |
| Vegetables | Green pepper with pork | 150 kcal |
| Vegetables | Shredded potatoes | 120 kcal |
| Bakery | Bread/Cake | 250-350 kcal |
File Paths
- - Temp images: INLINECODE5
- Daily records: INLINECODE6
- Target calories: INLINECODE7
Example Output
CODEBLOCK1
🔥 照片卡路里追踪器 (image-calorie-tracker)
识别食物照片,记录每日卡路里摄入量,并生成报告。
运行时机
- - 用户发送食物图片时
- 用户询问过去X天的卡路里数据时(X为任意数字)
工作流程
记录餐食
- 1. 将图片复制到 /root/.openclaw/workspace/temp_qqdata/YYYY-MM-DD-meal.jpg
- 使用 image 工具识别食物
- 估算每种食物的卡路里
- 更新 /root/.openclaw/workspace/memory/YYYY-MM-DD.md
生成报告
- 1. 从 /root/.openclaw/workspace/memory/ 读取目标日期的记录
- 从 /root/.openclaw/workspace/skills/image-calorie-tracker/config/target_calorie.txt 读取目标卡路里
- 按要求的格式输出报告
输出格式
📊 卡路里追踪 | 目标:{target}
【MM-DD】{status}
{早餐(如有)}: {calories}
{午餐(如有)}: {calories}
{晚餐(如有)}: {calories}
{零食(如有)}: {calories}
状态规则
- - 未完成:缺少午餐或晚餐(早餐不计入)
- {percent}%:总卡路里与目标的差值;正数表示超标,负数表示不足
餐食显示规则
- - 仅显示午餐、晚餐和零食(早餐不计入)
- 省略未记录的餐食
- 卡路里单位:千卡
餐食定义
- - 午餐:约12:00,约300-800千卡
- 晚餐:约18:00,约400-1000千卡
- 零食:午餐和晚餐之间的零食/甜点
食物卡路里参考
| 类别 | 食物 | 卡路里(每100克) |
|---|
| 主食 | 米饭 | 130千卡 |
| 主食 |
杂粮饭 | 120千卡 |
| 肉类 | 炸鸡排 | 280千卡 |
| 肉类 | 炒肉片 | 180千卡 |
| 蔬菜 | 青椒肉丝 | 150千卡 |
| 蔬菜 | 土豆丝 | 120千卡 |
| 烘焙 | 面包/蛋糕 | 250-350千卡 |
文件路径
- - 临时图片:/root/.openclaw/workspace/tempqqdata/
- 每日记录:/root/.openclaw/workspace/memory/YYYY-MM-DD.md
- 目标卡路里:/root/.openclaw/workspace/skills/image-calorie-tracker/config/targetcalorie.txt
输出示例
📊 卡路里追踪 | 目标:2100
【03-16】+7%
午餐: 1115
【03-17】未完成
午餐: 820
零食: 280