SAM
New in version 1.1
Overviews
SAM stands for Segment Anything Model
APIs
Model
Bases: BaseModel
build_model(custom_weight=None)
Build model in SAM model
Returns:
Name | Type | Description |
---|---|---|
_type_ |
description |
process_image(image_path)
Process image in SAM model
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image_path |
_type_
|
img path |
required |
Returns:
Name | Type | Description |
---|---|---|
annotated_image |
numpy array |
|
masks |
list of mask in numpy array |
remove_background(image_path, output_path)
Remove background by SAM model then save image to specified directory
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image_path |
str
|
input image path |
required |
output_path |
str
|
output image path |
required |