Skip to main content

SegMate package

Project description

This repository is a toolkit for using the Segment Anything Model (SAM) developed by Meta AI. It is capable of accurately “cutting out” any object from an image with just a single click.

SAM is a promptable segmentation system that exhibits zero-shot generalization to unfamiliar objects and images, eliminating the need for additional training. By providing prompts that specify what needs to be segmented in an image, SAM can perform a wide range of segmentation tasks without requiring additional training.

Features

  • Easy inference with SAM, supporting bounding boxes, points, masks, and text prompts

  • Automatic masking without the need for prompts

  • Finetune SAM on custom datasets

  • GroundingDINO integration for text prompt segmentation

Installation

To install segmate from PyPI:

pip install segmate

Example Usage

To use the provided code snippets, follow the steps below:

  1. Import the required modules and initialize the necessary objects:

import torch

from segmate.segmate import SegMate
from segmate.object_detector import GroundingDINO
import segmate.utils as utils

od = GroundingDINO()
sm = SegMate(model_type='MODEL_TYPE', checkpoint='PATH_to_MODEL', device='cuda', object_detector=od)
  1. Perform segmentation with bounding box prompts:

masks = sm.segment(image=input_image, boxes_prompt=bbox)
utils.show_masks(masks)

Documentation

Detailed package documentation: SegMate Docs

If you have any questions or need assistance, please don’t hesitate to reach out to our support team or join our community forum. We hope you find this toolkit valuable and look forward to seeing the incredible applications you create with SAM!

License

The code in this repository is published under 3-Clause BSD license (see LICENSE file).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

segmate-0.1.0.tar.gz (3.5 MB view details)

Uploaded Source

Built Distribution

segmate-0.1.0-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file segmate-0.1.0.tar.gz.

File metadata

  • Download URL: segmate-0.1.0.tar.gz
  • Upload date:
  • Size: 3.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for segmate-0.1.0.tar.gz
Algorithm Hash digest
SHA256 78f30449f318e3c72f210e6867e195a29763ac833bb7d559e0b795b0967eaad0
MD5 061b4afe1996878fef3e69a5b0d1cc72
BLAKE2b-256 7b9d783230168a7e433fd0de2e0103f680cb24bcb4ad6cbbc9d19f47edca47a7

See more details on using hashes here.

File details

Details for the file segmate-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: segmate-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for segmate-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9a771cab253f193896c2f993844e813847a7acd1e1e27fa014d92665e27fa405
MD5 4f01c7783b710d4b5f7a5a2c93da0cf4
BLAKE2b-256 314d49a1b1a05d677395d9b86c0e4125faba6ed40f2fe57e74ff89706303560f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page