executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
image-aiUse ImageAI 3.x PyTorch computer-vision workflows for classification, object detection, video detection, and custom training.
Independent GitHub snapshot · Automated classification · Original documentation governs
Use this repo skill when a task involves the ImageAI Python package (imageai), especially ImageAI 3.x PyTorch workflows for simple computer-vision applications.
.pt or .pth). TensorFlow/Keras .h5 models are legacy ImageAI 2.x artifacts and are not accepted by the current package path.python scripts/check_imageai_env.py
python scripts/check_imageai_env.py --require-cuda
| User task | Read |
|---|---|
| Classify a still image with ImageNet weights | classification-workflows |
Run custom image classification from a trained .pt/.pth model and classes JSON | classification-workflows |
| Detect COCO objects in a still image with RetinaNet, YOLOv3, or TinyYOLOv3 | object-detection-workflows |
| Run custom YOLO/TinyYOLO still-image detection from a trained model and detection JSON | object-detection-workflows |
| Detect objects in videos, camera feeds, or live streams | video-detection-workflows |
| Add per-frame, per-second, per-minute, or whole-video analysis callbacks | video-detection-workflows |
| Prepare datasets, convert Pascal VOC to YOLO, validate layouts, or start custom training | custom-training-and-data |
| Resolve install, backend, or model-asset confusion | installation and model assets and troubleshooting |
ImageAI 3.x uses PyTorch. A typical CPU-oriented setup follows the package docs and requirements:
pip install imageai
pip install cython "pillow>=7.0.0" "numpy>=1.18.1" "opencv-python>=4.1.2" \
"torch>=1.9.0" "torchvision>=0.10.0" tqdm scipy matplotlib mock
Use a PyTorch CUDA wheel only when the runtime has compatible NVIDIA drivers and the task needs acceleration. CUDA is helpful for video and real training, but CPU is enough for import/API checks and small validation helpers. See installation and model assets for dependency variants, model-weight expectations, and legacy TensorFlow notes.
from imageai.Classification import ImageClassification
from imageai.Detection import ObjectDetection, VideoObjectDetection
from imageai.Classification.Custom import ClassificationModelTrainer, CustomImageClassification
from imageai.Detection.Custom import DetectionModelTrainer, CustomObjectDetection, CustomVideoObjectDetection
for cls in [
ImageClassification, ObjectDetection, VideoObjectDetection,
ClassificationModelTrainer, CustomImageClassification,
DetectionModelTrainer, CustomObjectDetection, CustomVideoObjectDetection,
]:
cls()
If this fails, do not proceed to weight loading. Use the root troubleshooting reference first.
.pt or .pth; .h5 triggers a TensorFlow-legacy error.useCPU() before loadModel() when forcing CPU.