Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/danielgatis/rembg
/ functions
Functions
104 in github.com/danielgatis/rembg
⨍
Functions
104
◇
Types & classes
24
↳
Endpoints
5
↓ 41 callers
Method
u2net_home
(cls, *args, **kwargs)
rembg/sessions/base.py:75
↓ 20 callers
Method
name
Class method to return a string value. This method returns the string value 'sam'. Parameters: cls: The class o
rembg/sessions/sam.py:377
↓ 15 callers
Method
checksum_disabled
(cls, *args, **kwargs)
rembg/sessions/base.py:71
↓ 12 callers
Method
normalize
( self, img: PILImage, mean: Tuple[float, float, float], std: Tuple[float, flo
rembg/sessions/base.py:40
↓ 7 callers
Function
new_session
Create a new session object based on the specified model name. This function searches for the session class based on the model name in the '
rembg/session_factory.py:11
↓ 6 callers
Function
remove
Remove the background from an input image. This function takes in various parameters and returns a modified version of the input image with
rembg/bg.py:226
↓ 2 callers
Method
download_models
Class method to download ONNX model files. This method is responsible for downloading two ONNX model files from specified URLs and s
rembg/sessions/sam.py:299
↓ 2 callers
Function
naive_cutout
Perform a simple cutout operation on an image using a mask. This function takes a PIL image `img` and a PIL image `mask` as input. It us
rembg/bg.py:98
↓ 2 callers
Function
process
(each_input: pathlib.Path)
rembg/commands/p_command.py:157
↓ 2 callers
Function
putalpha_cutout
Apply the specified mask to the image as an alpha cutout. Args: img (PILImage): The image to be modified. mask (PILImage): T
rembg/bg.py:114
↓ 2 callers
Function
warp_affine
Apply affine transformation to an image (matching cv2.warpAffine behavior). cv2.warpAffine maps source coordinates to destination coordinate
rembg/sessions/sam.py:16
↓ 1 callers
Function
_is_private_ip
(host: str)
rembg/commands/s_command.py:244
↓ 1 callers
Function
_validate_url
(url: str)
rembg/commands/s_command.py:261
↓ 1 callers
Function
alpha_matting_cutout
Perform alpha matting on an image using a given mask and threshold values. This function takes a PIL image `img` and a PIL image `mask` as i
rembg/bg.py:45
↓ 1 callers
Function
apply_background_color
Apply the specified background color to the image. Args: img (PILImage): The image to be modified. color (Tuple[int, int, in
rembg/bg.py:175
↓ 1 callers
Function
apply_coords
(coords: np.ndarray, original_size, target_length)
rembg/sessions/sam.py:78
↓ 1 callers
Function
connect_stdin_stdout
()
rembg/commands/b_command.py:143
↓ 1 callers
Function
download_models
Download models for image processing.
rembg/bg.py:205
↓ 1 callers
Method
download_models
(cls, *args, **kwargs)
rembg/sessions/base.py:83
↓ 1 callers
Function
fix_image_orientation
Fix the orientation of the image based on its EXIF data. Args: img (PILImage): The image to be fixed. Returns: PILImage
rembg/bg.py:192
↓ 1 callers
Function
get_concat_v
Concatenate two images vertically. Args: img1 (PILImage): The first image. img2 (PILImage): The second image to be concatena
rembg/bg.py:145
↓ 1 callers
Function
get_concat_v_multi
Concatenate multiple images vertically. Args: imgs (List[PILImage]): The list of images to be concatenated. Returns: PI
rembg/bg.py:129
↓ 1 callers
Function
get_input_points
(prompt)
rembg/sessions/sam.py:91
↓ 1 callers
Function
get_preprocess_shape
(oldh: int, oldw: int, long_side_length: int)
rembg/sessions/sam.py:69
↓ 1 callers
Function
gr_app
(app)
rembg/commands/s_command.py:307
↓ 1 callers
Function
img_to_byte_array
(img: PIL.Image.Image)
rembg/commands/b_command.py:138
↓ 1 callers
Function
main
()
rembg/cli.py:30
↓ 1 callers
Function
main
()
rembg/commands/b_command.py:156
↓ 1 callers
Method
name
Returns the name of the U2net session. Parameters: *args: Additional positional arguments. **kwargs: Additio
rembg/sessions/u2net.py:77
↓ 1 callers
Method
name
Returns the name of the BiRefNet-COD session. Parameters: *args: Additional positional arguments. **kwargs:
rembg/sessions/birefnet_cod.py:41
↓ 1 callers
Method
name
(cls, *args, **kwargs)
rembg/sessions/u2net_cloth_seg.py:142
↓ 1 callers
Method
name
Get the name of the pre-trained model. Parameters: *args: Variable length argument list. **kwargs: Arbitrary
rembg/sessions/dis_anime.py:75
↓ 1 callers
Method
name
Returns the name of the BiRefNet-Portrait session. Parameters: *args: Additional positional arguments. **kwa
rembg/sessions/birefnet_portrait.py:41
↓ 1 callers
Method
name
Returns the name of the U2netp model. Returns: str: The name of the model.
rembg/sessions/u2netp.py:69
↓ 1 callers
Method
name
Returns the name of the BiRefNet-HRSOD session. Parameters: *args: Additional positional arguments. **kwargs
rembg/sessions/birefnet_hrsod.py:41
↓ 1 callers
Method
name
Returns the name of the Bria-rmbg session. Parameters: *args: Additional positional arguments. **kwargs: Add
rembg/sessions/bria_rmbg.py:77
↓ 1 callers
Method
name
Return the name of the model. This method returns the name of the Silueta model. Parameters: *args: Variable le
rembg/sessions/silueta.py:79
↓ 1 callers
Method
name
Returns the name of the BiRefNet-General session. Parameters: *args: Additional positional arguments. **kwar
rembg/sessions/birefnet_general.py:80
↓ 1 callers
Method
name
Returns the name of the BiRefNet-DIS session. Parameters: *args: Additional positional arguments. **kwargs:
rembg/sessions/birefnet_dis.py:41
↓ 1 callers
Method
name
Returns the name of the BiRefNet-Massive session. Parameters: *args: Additional positional arguments. **kwar
rembg/sessions/birefnet_massive.py:41
↓ 1 callers
Method
name
Returns the name of the BiRefNet-General-Lite session. Parameters: *args: Additional positional arguments. *
rembg/sessions/birefnet_general_lite.py:41
↓ 1 callers
Method
name
Returns the name of the model. This class method returns the name of the model. Parameters: args: Additional po
rembg/sessions/dis_general_use.py:73
↓ 1 callers
Method
name
Returns the name of the U2Net model. Parameters: *args: Variable length argument list. **kwargs: Arbitrary k
rembg/sessions/u2net_human_seg.py:77
↓ 1 callers
Function
post_process
Post Process the mask for a smooth boundary by applying Morphological Operations Research based on paper: https://www.sciencedirect.com/scien
rembg/bg.py:162
↓ 1 callers
Method
predict
Predict masks for an input image. This function takes an image as input and performs various preprocessing steps on the image. It th
rembg/sessions/sam.py:166
↓ 1 callers
Method
sigmoid
(self, mat)
rembg/sessions/birefnet_general.py:17
↓ 1 callers
Function
transform_masks
(masks, original_size, transform_matrix)
rembg/sessions/sam.py:109
Method
__init__
Initialize a new BenCustomSession object. Parameters: model_name (str): The name of the model. sess_opts: Th
rembg/sessions/ben_custom.py:15
Method
__init__
Initialize an instance of the BaseSession class.
rembg/sessions/base.py:13
Method
__init__
Initialize a new DisCustomSession object. Parameters: model_name (str): The name of the model. sess_opts: Th
rembg/sessions/dis_custom.py:15
Method
__init__
Initialize a new SamSession with the given model name and session options. Args: model_name (str): The name of the model
rembg/sessions/sam.py:138
Method
__init__
Initialize a new U2netCustomSession object. Parameters: model_name (str): The name of the model. sess_opts (
rembg/sessions/u2net_custom.py:16
Method
__init__
( self, model: str = Query( description="Model to use when processing
rembg/commands/s_command.py:112
Method
__init__
( self, model: str = Form( description="Model to use when processing i
rembg/commands/s_command.py:157
Function
b_command
Command-line interface for processing images by removing the background using a specified model and generating a mask. This CLI command take
rembg/commands/b_command.py:97
Function
d_command
Download models
rembg/commands/d_command.py:11
Method
download_models
Downloads the U2net model file from a specific URL and saves it. Parameters: *args: Additional positional arguments.
rembg/sessions/u2net.py:50
Method
download_models
Downloads the BiRefNet-COD model file from a specific URL and saves it. Parameters: *args: Additional positional argumen
rembg/sessions/birefnet_cod.py:14
Method
download_models
(cls, *args, **kwargs)
rembg/sessions/u2net_cloth_seg.py:125
Method
download_models
Download the pre-trained models. Parameters: *args: Variable length argument list. **kwargs: Arbitrary keywo
rembg/sessions/dis_anime.py:48
Method
download_models
Downloads the BiRefNet-Portrait model file from a specific URL and saves it. Parameters: *args: Additional positional ar
rembg/sessions/birefnet_portrait.py:14
Method
download_models
Downloads the U2netp model. Returns: str: The path to the downloaded model.
rembg/sessions/u2netp.py:46
Method
download_models
Downloads the BiRefNet-HRSOD model file from a specific URL and saves it. Parameters: *args: Additional positional argum
rembg/sessions/birefnet_hrsod.py:14
Method
download_models
Download the model files. Parameters: *args: Additional positional arguments. **kwargs: Additional keyword a
rembg/sessions/ben_custom.py:63
Method
download_models
Downloads the BRIA-RMBG 2.0 model file from a specific URL and saves it. Parameters: *args: Additional positional argume
rembg/sessions/bria_rmbg.py:50
Method
download_models
Download the pre-trained model file. This method downloads the pre-trained model file from a specified URL. The file is saved to the
rembg/sessions/silueta.py:50
Method
download_models
Download the model files. Parameters: *args: Additional positional arguments. **kwargs: Additional keyword a
rembg/sessions/dis_custom.py:62
Method
download_models
Downloads the BiRefNet-General model file from a specific URL and saves it. Parameters: *args: Additional positional arg
rembg/sessions/birefnet_general.py:53
Method
download_models
Downloads the BiRefNet-DIS model file from a specific URL and saves it. Parameters: *args: Additional positional argumen
rembg/sessions/birefnet_dis.py:14
Method
download_models
Downloads the BiRefNet-Massive model file from a specific URL and saves it. Parameters: *args: Additional positional arg
rembg/sessions/birefnet_massive.py:14
Method
download_models
Downloads the BiRefNet-General-Lite model file from a specific URL and saves it. Parameters: *args: Additional positiona
rembg/sessions/birefnet_general_lite.py:14
Method
download_models
Downloads the pre-trained model file. This class method downloads the pre-trained model file from a specified URL using the pooch li
rembg/sessions/dis_general_use.py:44
Method
download_models
Download the model files. Parameters: *args: Additional positional arguments. **kwargs: Additional keyword a
rembg/sessions/u2net_custom.py:68
Method
download_models
Downloads the U2Net model weights. Parameters: *args: Variable length argument list. **kwargs: Arbitrary key
rembg/sessions/u2net_human_seg.py:50
Method
full_cloth
()
rembg/sessions/u2net_cloth_seg.py:105
Function
get_index
( url: str = Query( default=..., description="URL of the image that has to be processed."
rembg/commands/s_command.py:276
Function
i_command
Click command line interface function to process an input file based on the provided options. This function is the entry point for the CLI p
rembg/commands/i_command.py:88
Function
im_without_bg
(content: bytes, commons: CommonQueryParams)
rembg/commands/s_command.py:201
Function
inference
(input_path, model, *args)
rembg/commands/s_command.py:308
Method
lower_cloth
()
rembg/sessions/u2net_cloth_seg.py:99
Method
name
Get the name of the model. Parameters: *args: Additional positional arguments. **kwargs: Additional keyword
rembg/sessions/ben_custom.py:87
Method
name
(cls, *args, **kwargs)
rembg/sessions/base.py:87
Method
name
Get the name of the model. Parameters: *args: Additional positional arguments. **kwargs: Additional keyword
rembg/sessions/dis_custom.py:86
Method
name
Get the name of the model. Parameters: *args: Additional positional arguments. **kwargs: Additional keyword
rembg/sessions/u2net_custom.py:92
Method
on_any_event
(self, event: FileSystemEvent)
rembg/commands/p_command.py:199
Function
p_command
Command-line interface (CLI) program for performing background removal on images in a folder. This program takes a folder as input and uses
rembg/commands/p_command.py:120
Function
post_index
( file: bytes = File( default=..., description="Image file (byte stream) that
rembg/commands/s_command.py:298
Method
predict
Predicts the output masks for the input image using the inner session. Parameters: img (PILImage): The input image.
rembg/sessions/u2net.py:17
Method
predict
Predict the cloth category of an image. This method takes an image as input and predicts the cloth category of the image. Th
rembg/sessions/u2net_cloth_seg.py:58
Method
predict
Use a pre-trained model to predict the object in the given image. Parameters: img (PILImage): The input image.
rembg/sessions/dis_anime.py:17
Method
predict
Predicts the mask for the given image using the U2netp model. Parameters: img (PILImage): The input image. Retu
rembg/sessions/u2netp.py:15
Method
predict
Predicts the mask image for the input image. This method takes a PILImage object as input and returns a list of PILImage objects as
rembg/sessions/ben_custom.py:31
Method
predict
(self, img: PILImage, *args, **kwargs)
rembg/sessions/base.py:67
Method
predict
Predicts the output masks for the input image using the inner session. Parameters: img (PILImage): The input image.
rembg/sessions/bria_rmbg.py:17
Method
predict
Predict the mask of the input image. This method takes an image as input, preprocesses it, and performs a prediction to generate a m
rembg/sessions/silueta.py:15
Method
predict
Predicts the mask image for the input image. This method takes a PILImage object as input and returns a list of PILImage objects as
rembg/sessions/dis_custom.py:31
Method
predict
Predicts the output masks for the input image using the inner session. Parameters: img (PILImage): The input image.
rembg/sessions/birefnet_general.py:20
Method
predict
Predicts the mask image for the input image. This method takes a PILImage object as input and returns a list of PILImage objects as
rembg/sessions/dis_general_use.py:13
Method
predict
Predict the segmentation mask for the input image. Parameters: img (PILImage): The input image. *args: Addit
rembg/sessions/u2net_custom.py:35
Method
predict
Predicts human segmentation masks for the input image. Parameters: img (PILImage): The input image. *args: V
rembg/sessions/u2net_human_seg.py:17
next →
1–100 of 104, ranked by callers