Ctrl + K
DocumentationLog inGet started

tessl/pypi-rembg

tessl install tessl/pypi-rembg@2.0.0

Remove image background using advanced AI models including U-Net, BiRefNet, and SAM with support for multiple input formats and GPU acceleration

Agent Success

Agent success rate when using this tile

84%

Improvement

Agent success rate improvement when using this tile compared to baseline

0.94x

Baseline

Agent success rate without this tile

89%

task.mdevals/scenario-6/

Batch Image Background Remover

A Python CLI tool that processes multiple images from a directory, removes their backgrounds, and saves the results to an output directory.

Requirements

The tool should accept two command-line arguments:

  1. Input directory path containing images to process
  2. Output directory path where processed images will be saved

The tool must:

  • Process all image files in the input directory (recursively including subdirectories)
  • Remove the background from each image
  • Save each processed image to the output directory with the same filename
  • Show progress during batch processing
  • Handle common image formats (PNG, JPG, JPEG)

Implementation

@generates

API

def process_batch(input_dir: str, output_dir: str) -> None:
    """
    Process all images in input_dir by removing backgrounds and saving to output_dir.

    Args:
        input_dir: Path to directory containing input images
        output_dir: Path to directory where processed images will be saved
    """
    pass

if __name__ == "__main__":
    # CLI entry point that accepts input_dir and output_dir as arguments
    pass

Test Cases

  • When given an input directory with 3 PNG images, it processes all 3 images and saves them to the output directory with backgrounds removed @test
  • When the output directory does not exist, it creates the output directory before saving processed images @test
  • When given an empty input directory, it completes without errors and produces no output files @test

Dependencies { .dependencies }

rembg { .dependency }

Provides background removal capabilities for images.

Version

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