AI scene analysis for device channel snapshot URLs (or any image URL) under an Imou account: human detection, smoking detection, phone-using detection, workwear and absence detection (with pre-configured workwear repository), shelf detection, trash detection, heatmap statistics, and face analysis. Also manage detect repositories and targets (create/list/delete repository; add/list/delete targets).
Install dependency:
bash
pip install requests
Set environment variables (required):
bash
export IMOU_APP_ID="your_app_id"
export IMOU_APP_SECRET="your_app_secret"
export IMOU_BASE_URL="your_base_url"
API Base URL (IMOU_BASE_URL) (required; no default—must be set explicitly):
appId and appSecret from App Information.appId and appSecret from App Information. See Development Specification.RegionData CenterBase URLMainland China—https://openapi.lechange.cnOverseasEast Asiahttps://openapi-sg.easy4ip.com:443OverseasCentral Europehttps://openapi-fk.easy4ip.com:443OverseasWestern Americahttps://openapi-or.easy4ip.com:443
Note: AI APIs are value-added; apply for access via Imou if needed.
Run analysis on an image URL (e.g. device channel snapshot from live coverUrl or any accessible URL):
bash
# Human detection
python3 {baseDir}/scripts/multimodal_analysis.py analyze HUMAN "https://example.com/snapshot.jpg"
# Smoking detection
python3 {baseDir}/scripts/multimodal_analysis.py analyze SMOKING "https://example.com/snapshot.jpg"
# Phone-using detection
python3 {baseDir}/scripts/multimodal_analysis.py analyze PHONE "https://example.com/snapshot.jpg"
# Workwear detection (optional repositoryId and threshold)
python3 {baseDir}/scripts/multimodal_analysis.py analyze WEAR "https://example.com/snapshot.jpg" [--repository-id REPO_ID] [--threshold 0.8]
# Absence detection (requires workwear repositoryId)
python3 {baseDir}/scripts/multimodal_analysis.py analyze ABSENCE "https://example.com/snapshot.jpg" --repository-id REPO_ID [--threshold 0.8]
# Shelf detection
python3 {baseDir}/scripts/multimodal_analysis.py analyze SHELF "https://example.com/snapshot.jpg"
# Trash detection
python3 {baseDir}/scripts/multimodal_analysis.py analyze TRASH "https://example.com/snapshot.jpg"
# Heatmap (threshold required; optional exclude repository IDs)
python3 {baseDir}/scripts/multimodal_analysis.py analyze HEATMAP "https://example.com/snapshot.jpg" --threshold 0.8 [--exclude-repos ID1,ID2]
# Face analysis
python3 {baseDir}/scripts/multimodal_analysis.py analyze FACE "https://example.com/snapshot.jpg"
Repository and target management:
bash
# Create detect repository (face | human for workwear)
python3 {baseDir}/scripts/multimodal_analysis.py repo create "MyWorkwearLib" human
# List repositories (paginated)
python3 {baseDir}/scripts/multimodal_analysis.py repo list [--page 1] [--page-size 20]
# Delete repository
python3 {baseDir}/scripts/multimodal_analysis.py repo delete REPOSITORY_ID
# Add target to repository (image URL or base64 type)
python3 {baseDir}/scripts/multimodal_analysis.py target add REPOSITORY_ID "TargetName" "https://image.url" [--type url]
python3 {baseDir}/scripts/multimodal_analysis.py target add REPOSITORY_ID "TargetName" "BASE64_DATA" --type base64
# List targets in repository
python3 {baseDir}/scripts/multimodal_analysis.py target list REPOSITORY_ID [--page 1] [--page-size 20]
# Delete target from repository
python3 {baseDir}/scripts/multimodal_analysis.py target delete REPOSITORY_ID TARGET_ID
All requests to Imou Open API must include the header Client-Type: OpenClaw for platform identification.
APIDocAI overviewhttps://open.imou.com/document/pages/f1b9a3/Dev spechttps://open.imou.com/document/pages/c20750/Get accessTokenhttps://open.imou.com/document/pages/fef620/humanDetecthttps://open.imou.com/document/pages/93rflk/smokingDetecthttps://open.imou.com/document/pages/kf70sq/phoneUsingDetecthttps://open.imou.com/document/pages/jf78o9/workwearDetecthttps://open.imou.com/document/pages/2jisd8/absenceDetecthttps://open.imou.com/document/pages/29dicv/shelfStatusDetecthttps://open.imou.com/document/pages/2oud87/trashOverflowDetecthttps://open.imou.com/document/pages/cdmfd6/heatmapDetecthttps://open.imou.com/document/pages/fdjfg9/faceAnalysishttps://open.imou.com/document/pages/28d7ug/createAiDetectRepositoryhttps://open.imou.com/document/pages/34ff11/listAiDetectRepositoryByPagehttps://open.imou.com/document/pages/5e8222/deleteAiDetectRepositoryhttps://open.imou.com/document/pages/5esi8a/addAiDetectTargethttps://open.imou.com/document/pages/ikdf78/listAiDetectTargethttps://open.imou.com/document/pages/278dkj/deleteAiDetectTargethttps://open.imou.com/document/pages/odty82/
See references/imou-ai-api.md for request/response formats.
type "0" for image URL, "1" for Base64. Snapshot URL can be device channel live cover URL (e.g. from imou-open-device-video skill liveList / bindDeviceLive streams[].coverUrl) or any accessible image URL.repositoryId to workwearDetect and absenceDetect.threshold in (0,1]. Use excludeRepositoryIds to exclude matched workwear persons (e.g. staff) and count only valid customers.DataSent toPurposeappId, appSecretImou Open APIObtain accessTokenaccessToken, image URL or Base64, repositoryId, threshold, etc.Imou Open APIAI detection and repository/target management
All requests go to the configured IMOU_BASE_URL. No other third parties.