Skip to content

Running very slowly #136

Open
Open

Description

@CurryKd7

image_path = ("/home/dongjun/zdj/code/CAST-simple/data/cityscapes/leftImg8bit/train/aachen"
"/aachen_000000_000019_leftImg8bit.png")

加载图像

raw_image = np.array(Image.open(image_path).convert("RGB"))

st = time.time()

构建模型

efficientvit_sam = create_sam_model(
name="xl1", weight_url="/home/dongjun/zdj/model/Efficientvit_sam/xl1.pt",
)
efficientvit_sam = efficientvit_sam.cuda().eval()
efficientvit_mask_generator = EfficientViTSamAutomaticMaskGenerator(efficientvit_sam)
masks, feat = efficientvit_mask_generator.generate(raw_image)
class EfficientViTSamAutomaticMaskGenerator(SamAutomaticMaskGenerator):
def init(
self,
model: EfficientViTSam,
points_per_side: int or None = 64,
points_per_batch: int = 128,
pred_iou_thresh: float = 0.86,
stability_score_thresh: float = 0.92,
stability_score_offset: float = 0.7,
box_nms_thresh: float = 0.7,
crop_n_layers: int = 0,
crop_nms_thresh: float = 0.7,
crop_overlap_ratio: float = 512 / 1500,
crop_n_points_downscale_factor: int = 1,
point_grids: list[np.ndarray] or None = None,
min_mask_region_area: int = 25,
output_mode: str = "binary_mask",

The above is my segmentation of a single image and the selection of some parameters. The running time is about 10 seconds or more, and it is not as efficient as SAM. May I ask why?

Activity

  1. the-cat-crying commented on Jan 6, 2025

    @the-cat-crying

    me too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions