or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/imutils@0.5.x
tile.json

tessl/pypi-imutils

tessl install tessl/pypi-imutils@0.5.0

A series of convenience functions to make basic image processing functions such as translation, rotation, resizing, skeletonization, displaying Matplotlib images, sorting contours, detecting edges, and much more easier with OpenCV and both Python 2.7 and Python 3.

Agent Success

Agent success rate when using this tile

91%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.34x

Baseline

Agent success rate without this tile

68%

task.mdevals/scenario-5/

Image Dataset Analyzer

Build an image dataset analyzer that discovers and reports statistics about images in a directory structure.

Requirements

Your analyzer should:

  1. Accept a directory path as input
  2. Find all image files recursively within that directory and its subdirectories
  3. Count the total number of images found
  4. Optionally filter images by a substring in their filename
  5. Report the file paths of all discovered images

The analyzer should support common image formats including JPEG, PNG, BMP, and TIFF files.

Implementation

@generates

API

def analyze_images(directory_path, filter_substring=None):
    """
    Analyzes images in a directory structure.

    Args:
        directory_path: Path to the directory to search
        filter_substring: Optional substring to filter filenames

    Returns:
        A dictionary containing:
        - 'count': Total number of images found
        - 'paths': List of image file paths
    """
    pass

Test Cases

  • Given a directory with 5 image files (2 JPEG, 2 PNG, 1 BMP) across multiple subdirectories, analyze_images returns count of 5 and all file paths @test
  • Given a directory with 10 images where 3 filenames contain "dog", analyze_images with filter_substring="dog" returns count of 3 and only those 3 paths @test
  • Given an empty directory, analyze_images returns count of 0 and empty paths list @test

Dependencies { .dependencies }

imutils { .dependency }

Provides image processing utilities including file discovery functions.