计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
classification-workflows【效率与协作】Use ImageAI ImageNet and custom image classification inference workflows with PyTorch model weights.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this sub-skill when the task is to classify still images with ImageAI's PyTorch classification APIs:
ImageClassification and built-in ImageNet class labels.CustomImageClassification, an ImageAI-trained .pt/.pth model, and the matching JSON class mapping.result_count selection, file/numpy/PIL image inputs, and the returned label/probability arrays.Do not use this sub-skill for custom model training or dataset preparation; route those requests to custom-training-and-data. Do not use it for object detection or video detection; route those to the detection sub-skills.
.h5 files, mismatched model type/weights, bad JSON mappings, image input errors, and warning noise.ImageClassification and CustomImageClassification that prints JSON and never downloads weights.For package-wide installation, backend, and model-asset policy, also check the root skill's installation and model assets notes.
--model-type or the setter method to the architecture used by the weights: mobilenetv2, resnet50, inceptionv3, or densenet121..h5 weights for ImageAI 3.x. Use .pt or .pth; for .h5, explain the ImageAI 2.1.6-or-earlier compatibility path instead of trying to load it.setModelPath(...), custom setJsonPath(...) when needed, optional useCPU(), then loadModel() before classifyImage(...).labels: list[str] and probabilities: list[float] in descending score order.Use the bundled helper for command-line classification when the user supplies local asset paths:
python scripts/classify_image.py \
--mode imagenet \
--model-type resnet50 \
--model-path /path/to/resnet50-weights.pth \
--image /path/to/image.jpg \
--result-count 5 \
--cpu
For custom classification, add --json-path /path/to/model_classes.json and keep --model-type aligned with the architecture used during training. The helper accepts image files only; in-process API usage can pass str paths, numpy.ndarray, or PIL.Image.Image objects as described in the API reference.