No project description provided
Project description
This repo is a packaged version of the segment-anything model.
Installation
pip install metaseg
Usage
from metaseg import SegAutoMaskGenerator
# If gpu memory is not enough, reduce the points_per_side and points_per_batch.
# For image
autoseg_image = SegAutoMaskGenerator().save_image(
source="image.jpg",
model_type="vit_l", # vit_l, vit_h, vit_b
points_per_side=16,
points_per_batch=64,
min_area=0,
)
# For video
autoseg_video = SegAutoMaskGenerator().save_video(
source="video.mp4",
model_type="vit_l", # vit_l, vit_h, vit_b
points_per_side=16,
points_per_batch=64,
min_area=1000,
)
# For manuel box selection
from metaseg import SegManualMaskGenerator
seg_manual_mask_generator = SegManualMaskGenerator().save_image(
source="image.jpg",
model_type="vit_l", # vit_l, vit_h, vit_b
x0=100,
y0=100,
x1=200,
y1=200,
)
Extra Features
- Support for video files
- Support for pip installation
- Support for web application
- Support for box to polygon conversion
- Support for automatic download model weights
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
metaseg-0.3.4.tar.gz
(34.2 kB
view hashes)