github star gitee star atomgit star PyPI Downloads AI编程 AI交流群

Hello everyone, this is programmer Wan Feng actively working on various AI projects.

In my previous article I compared 5 major companies' Lobster Coding Plans, many readers asked: "Wan Feng, stop talking and show us a practical tutorial!"

Okay, today's beginner-friendly tutorial takes you from scratch, using 5 companies' tools to build a lobster freshness detection system.

Tutorial Features:

  • ✅ Every step has code and screenshots
  • ✅ Provides complete runnable code
  • ✅ Contains common errors and solutions
  • ✅ Suitable for zero-basis beginners

📋 Preparation Work

Environment Requirements

ItemRequirement
Python3.9+
Memory8GB+
Hard Drive20GB+
NetworkCan access internet

Register Accounts

Need to register the following platform accounts in advance:

  1. Tencent Cloud
  2. Alibaba Cloud
  3. Baidu Intelligent Cloud
  4. ByteDance Volcano Engine
  5. Huawei Cloud

Prepare Dataset

I compiled a public lobster dataset (1000 images, labeled):


Step 1: Install OpenClaw

1
2
3
4
5
6
# Install OpenClaw CLI
pip install openclaw

# Initialize project
openclaw init lobster-detector
cd lobster-detector

Step 2: Configure Model

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Edit configuration file
cat > config.yaml << EOF
model:
provider: tencent
name: hunyuan-vision-pro
api_key: your_Tencent_Cloud_API_key

dataset:
path: ./data/lobster
train_split: 0.8

task:
type: image_classification
labels: ["fresh", "not_fresh", "grade_A", "grade_B", "grade_C", "grade_D"]
EOF

Step 3: Write Skill

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# skills/lobster_detector.py
from openclaw import skill
import requests

@skill.register
def detect_lobster_freshness(image_url: str) -> dict:
"""
Detect lobster freshness

Args:
image_url: Lobster image URL

Returns:
Dictionary containing freshness and grade
"""
# Call Tencent Hunyuan Vision API
response = requests.post(
"https://api.tencent.com/vision/lobster",
json={
"image_url": image_url,
"task": "freshness_detection"
},
headers={
"Authorization": f"Bearer {YOUR_API_KEY}"
}
)

result = response.json()

return {
"fresh": result["confidence"] > 0.85,
"grade": result["grade"], # A/B/C/D
"confidence": result["confidence"],
"suggested_price": result["price_suggestion"]
}

🎓 AI Programming Course

Want to learn AI programming systematically? Check out CoderWanFeng's AI Programming Course!