Search your camera's visual history with natural language.
Monitor your camera feed, capture frames automatically, and retrieve matching images by simply describing what you're looking for. Powered by the Kamivision cloud API for AI description and embedding generation.
bash
bash setup.sh
Checks for Python 3.10, creates .venv/, and installs opencv-python-headless, numpy, requests, Pillow, faiss-cpu. Idempotent.
image_config.json configured with your stream URL(s) and Kamivision API keyThis skill requires a KAMIVISION_API_KEY to access the Kamivision cloud API.
Check: Read the KAMIVISION_API_KEY field in image_config.json.
If already configured (non-empty) → Use it directly, no need to ask.
If empty → Ask the user if they already have an API Key:
image_config.json.Before running, confirm these key settings in image_config.json:
ParameterDefaultDescriptioncameras(array)Camera list. Each entry requires STREAM_URL and DEVICE_ID``cameras[].STREAM_URL—RTSP/RTMP/HTTP camera stream URLcameras[].DEVICE_ID``CAM-001Unique camera device identifiercameras[].CAPTURE_INTERVAL``10Seconds between frame captures (per-camera override)KAMIVISION_API_KEY—Your Kamivision API key (shared across all cameras)SIMILARITY_THRESHOLD``0.35Search similarity threshold (0.0–1.0)SEARCH_TOP_K``5Max results per searchTIME_ZONE_OFFSET``0UTC offset in hours for local time display (e.g. -12 for UTC+12, 8 for UTC+8)
json
{
"cameras": [
{
"STREAM_URL": "rtsp://192.168.1.100/stream",
"DEVICE_ID": "CAM-FRONT",
"CAPTURE_INTERVAL": 10
},
{
"STREAM_URL": "rtsp://192.168.1.101/stream",
"DEVICE_ID": "CAM-BACK",
"CAPTURE_INTERVAL": 15
}
],
"KAMIVISION_API_KEY": "your-api-key",
"DATA_DIR": "./image_data",
"TIME_ZONE_OFFSET": -12
}
DEVICE_ID must be unique across all camerasCAPTURE_INTERVAL, OUTPUT_WIDTH, SKIP_DUPLICATE, etc.)cameras array) is still supported for backward compatibilityMUST show this table to the user when configuring cameras, so they can pick a URL pattern based on their brand:
Brand keyBrandURL patternhikvisionHikvisionrtsp://{user}:{pwd}@{ip}:554/Streaming/Channels/101 ( 101 =ch1 main, 102 =ch1 sub)dahuaDahuartsp://{user}:{pwd}@{ip}:554/cam/realmonitor?channel=1&subtype=0 ( subtype=0 main, 1 sub)tplinkTP-Linkrtsp://{user}:{pwd}@{ip}:554/stream1 ( stream1 main, stream2 sub)ezvizEZVIZrtsp://admin:{verify_code}@{ip}:554/H264/ch1/main/av_stream``univiewUniviewrtsp://{user}:{pwd}@{ip}:554/media/video1``reolinkReolinkrtsp://{user}:{pwd}@{ip}:554/h264Preview_01_main
Ask the user: do any parameters need to be changed?
bash
# Start all cameras
.venv/bin/python image_search.py --start-capture
# Start a specific camera
.venv/bin/python image_search.py --start-capture --device CAM-FRONT
bash
# Stop all cameras
.venv/bin/python image_search.py --stop-capture
# Stop a specific camera
.venv/bin/python image_search.py --stop-capture --device CAM-FRONT
bash
# Status of all cameras
.venv/bin/python image_search.py --status
# Status of a specific camera
.venv/bin/python image_search.py --status --device CAM-FRONT
bash
# Single image
.venv/bin/python image_search.py --import /path/to/photo.jpg --json
# Entire directory (recursive)
.venv/bin/python image_search.py --import /path/to/photos/ --json
bash
# Search across all cameras
.venv/bin/python image_search.py --search "keys on the table" --json
# Search a specific camera only
.venv/bin/python image_search.py --search "keys on the table" --device CAM-FRONT --json
bash
.venv/bin/python image_search.py \
--search "person in blue jacket" \
--time-start 1754538000 --time-end 1754541600 \
--json
json
{
"status": "ok",
"query": "keys on the table",
"count": 1,
"results": [
{
"image_name": "CAM-FRONT_1754538507.jpg",
"image_path": "/opt/image_data/CAM-FRONT/20250815/CAM-FRONT_1754538507.jpg",
"description": "A set of keys and a wallet on a table",
"device_id": "CAM-FRONT",
"timestamp": 1754538507,
"time": "2025-08-15 10:00:07 AM",
"score": 0.7823
}
]
}
CodeMeaning0Success1Error (config issue, stream failure, API error, runtime exception)
bash: .venv/bin/python: No such file or directory → Run bash setup.shOpenCV cannot open stream → Check camera is online and STREAM_URL is correctKamivision API error → Verify KAMIVISION_API_KEY and network connectivityUnsupported file format → Only JPEG, PNG, BMP, WebP are supportedNo search results → Ensure images have been captured/imported; try lowering SIMILARITY_THRESHOLDFAISS index load failed → Index may be corrupted; system rebuilds automatically, re-import data if neededThis skill involves camera video stream frame capture and cloud-based image analysis. Please review the following privacy information before use:
retention_days parameter for automatic expiration and deletion of historical data~/.kami/credentials.json (permission 600, readable only by the current user)For more details on our privacy policy, visit: https://kamiclaw-skill.kamihome.com/privacy