Documentation 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.
kermit_model_evaluation.py is the main command-line entry point for the Detect Kermit project. It loads the trained ResNet model and runs predictions on either a single image, a comma-separated list of images, or a full video file. The script uses Python’s asyncio event loop internally, so predictions across multiple images or video frames are dispatched concurrently.
Synopsis
Flags / Arguments
The type of input to classify. Accepted values:
image or video.Path to the file(s) to classify. When
--file_type is image, accepts a comma-separated list of image paths. When --file_type is video, accepts a single .avi video path.Short flag aliases
| Short flag | Long flag |
|---|---|
-t | --file_type |
-f | --files |
Examples
Output behaviour
Image input
When--file_type image is used, the script prints class probabilities to stdout for each image supplied. For example:
Video input
When--file_type video is used, the script:
- Opens the
.avifile with OpenCV and calculates the total duration in seconds. - Extracts one frame per second (at 1 000 ms intervals) and saves each frame to
episode3_results/as a JPEG: - Runs
predict_imageconcurrently on every extracted frame. - Writes a text banner directly onto each saved JPEG showing the prediction results, for example:
The overlay is rendered in red using
cv2.FONT_HERSHEY_PLAINat position(130, 25).
If the
-f flag is omitted entirely, the script defaults to looking for MuppetsEpisode3.avi in the current working directory. Make sure you run the script from the repository root, or pass the full path explicitly with -f /path/to/your/video.avi.