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-4/

Image Background Remover

Build a simple Python script that removes backgrounds from images using AI models.

Requirements

Your script should:

  1. Accept an input image file path and an output image file path as command-line arguments
  2. Load the input image from disk
  3. Remove the background from the image using an AI model
  4. Save the processed image with transparent background to the output path

Implementation Details

  • The script should be executable from the command line: python solution.py input.jpg output.png
  • Handle common image formats (JPEG, PNG, etc.)
  • The output should have a transparent background (alpha channel)
  • Use appropriate error handling for invalid file paths

@generates

API

# Command-line script that processes images
# Usage: python solution.py <input_path> <output_path>

Test Cases

  • Given an image file test_image.jpg, running the script produces an output file with the background removed @test
  • Given a non-existent input file, the script handles the error gracefully @test
  • The output image has an alpha channel (transparency) for the background @test

Dependencies { .dependencies }

rembg { .dependency }

Provides background removal capabilities using AI models.

Version

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