Skip to content

Missing argparse and logic for flag no-remove-bg #80

Description

@abhishek47kashyap

The help for foreground-ratio mentions no-remove-bg but I don't see any logic related to no-remove-bg/arg.no_remove_bg

stable-fast-3d/run.py

Lines 30 to 35 in ff21fc4

parser.add_argument(
"--foreground-ratio",
default=0.85,
type=float,
help="Ratio of the foreground size to the image size. Only used when --no-remove-bg is not specified. Default: 0.85",
)

If I try python run.py /path/to/rgb.png --output-dir output/ --no-remove-bg, the error is run.py: error: unrecognized arguments: --no-remove-bg because there is no argparse for it.

On digging deeper I see that background removal is not optional:

stable-fast-3d/run.py

Lines 87 to 96 in ff21fc4

rembg_session = rembg.new_session()
images = []
idx = 0
for image_path in args.image:
def handle_image(image_path, idx):
image = remove_background(
Image.open(image_path).convert("RGBA"), rembg_session
)
image = resize_foreground(image, args.foreground_ratio)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions