Detect Kermit relies on a specific directory layout and two artefact files (aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ilirosmanaj/detect_kermit/llms.txt
Use this file to discover all available pages before exploring further.
.h5 model checkpoint and a .json class map) to function correctly. This page documents all configuration surfaces: the expected folder tree, the class-mapping JSON, the trained model file, pinned Python dependencies, and the EXECUTION_PATH convention used throughout the codebase.
Directory structure
The repository must be laid out as follows before running training or inference. Thetrain/ and test/ sub-directories are consumed directly by ImageAI’s ModelTraining and CustomImagePrediction APIs.
episode3_results/ directory is created manually (or expected to exist) before running video inference — the script writes annotated JPEG frames there at runtime.
model_class.json
ImageAI requires a class-map JSON file that translates integer class indices (as produced by the model’s softmax output layer) into human-readable label strings.
data/images/json/model_class.json
- Index
0→kermit— frames or images in which Kermit the Frog is detected. - Index
1→no-kermit— frames or images in which Kermit is not present.
loadModel is called.
Model file (kermit_finder.h5)
| Property | Value |
|---|---|
| Filename | kermit_finder.h5 |
| Location | data/images/models/kermit_finder.h5 |
| Format | HDF5 — Keras .h5 serialisation format |
| Architecture | ResNet, configured via setModelTypeAsResNet() |
| Storage | Tracked with Git LFS (Large File Storage) due to file size |
imageai_build_model.py and is subsequently loaded in kermit_model_evaluation.py with:
.h5 file after cloning the repository, make sure Git LFS is installed:
git lfs pull from the repository root to download the model checkpoint.
requirements.txt
All Python dependencies are pinned to exact versions for reproducibility. Install them with:
| Package | Version / Source | Purpose |
|---|---|---|
pandas | 0.23.4 | Data manipulation utilities |
imageai | 2.0.2 (GitHub wheel) | Custom image prediction and model training API |
pillow | 5.4.1 | Image I/O for rotation helpers |
keras | 2.2.4 | Deep learning backend (used by ImageAI) |
opencv-python | 4.0.0.21 | Video capture and frame annotation |
scipy | 1.2.0 | Scientific computing (ImageAI dependency) |
matplotlib | 3.0.2 | Plotting and visualisation |
h5py | 2.9.0 | Reading and writing .h5 model files |
tensorflow | 1.12.0 | ML framework (CPU build) |
tensorflow-gpu | 1.12.0 | ML framework (GPU build) |
google_images_download | latest | Downloading additional training images from Google |
imageai is installed directly from the GitHub release wheel rather than PyPI:
EXECUTION_PATH
At the top of kermit_model_evaluation.py, the current working directory is captured once at import time: