Skip to content
Back to skills

Classification Workflows

ASecurity

"Use ImageAI ImageNet and custom image classification inference

  • 247 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 8, 2026
datapythonbashapibackend

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill classification-workflows --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Classification Workflows?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Classification Workflows
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-classification-workflows/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-classification-workflows)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: classification-workflows
description: "Use ImageAI ImageNet and custom image classification inference
  workflows with PyTorch model weights."
disable-model-invocation: true
metadata:
  disco-role: operating
license: MIT
---

# Classification Workflows

Use this sub-skill when the task is to classify still images with ImageAI's PyTorch classification APIs:

- ImageNet classification with `ImageClassification` and built-in ImageNet class labels.
- Custom classification inference with `CustomImageClassification`, an ImageAI-trained `.pt`/`.pth` model, and the matching JSON class mapping.
- CPU-forced classification, `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](../custom-training-and-data/SKILL.md). Do not use it for object detection or video detection; route those to the detection sub-skills.

## Runtime references

- [API reference](references/api-reference.md): verified class names, call order, method signatures, model type mapping, input forms, return shapes, and model extension behavior.
- [Workflows](references/workflows.md): ImageNet and custom classification recipes, asset prerequisites, CPU-only commands, validation steps, and in-process examples.
- [Troubleshooting](references/troubleshooting.md): classification-specific recovery for missing dependencies, TensorFlow `.h5` files, mismatched model type/weights, bad JSON mappings, image input errors, and warning noise.
- [Helper script](scripts/classify_image.py): parameterized CLI wrapper around `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](../../references/installation-and-model-assets.md) notes.

## Quick routing checklist

1. Ask whether the user has ImageNet release weights or a custom ImageAI-trained classifier. ImageNet mode needs only the model file; custom mode also needs the JSON class mapping produced during training.
2. Match `--model-type` or the setter method to the architecture used by the weights: `mobilenetv2`, `resnet50`, `inceptionv3`, or `densenet121`.
3. Reject TensorFlow-era `.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.
4. Call the model type setter, `setModelPath(...)`, custom `setJsonPath(...)` when needed, optional `useCPU()`, then `loadModel()` before `classifyImage(...)`.
5. Treat outputs as two parallel arrays: `labels: list[str]` and `probabilities: list[float]` in descending score order.

## Safe helper use

Use the bundled helper for command-line classification when the user supplies local asset paths:

```bash
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.

Files in this skill

  • SKILL.md3.3 KB
  • references/api-reference.md9.6 KB
  • references/troubleshooting.md7.1 KB
  • references/workflows.md7.7 KB
  • scripts/classify_image.py9.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.