Skip to main content

Open vocabulary segmentation

Models

  • GroundingDINO
  • MobileSAMv2:
    • trt (predictor, generator)
    • torch (predictor)
  • MobileSAMv1 (predictor, generator)

Usage

Get detection

from ovsegmentation import build_segmentator, visualize, get_waypoint, OVSegmentation
input_data = {
    "image": image,
    "text": ovd_prompt,
    "depth": depth_image,
    "intrinsics": intrinsics,
    "tf": None 
}
Note: "tf" could be None or transform_matrix: np.array (4,4) 

ovs = build_segmentator(weights_path='weights')

res = ovs.get_detections(input_data, detect_most_confident=False)
# res = ovs.generate_masks(input_data)

Visualize

annotated_image, labels = visualize(
    image, res, instance_random_color=True, draw_bbox=True
)
plt.figure(figsize=(15, 8))
plt.imshow(annotated_image)
plt.show()

Weights structure

Weights structure:

  • MobileSAMv2:
    • trt
      • WEIGHTS_DIR/MobileSAM/l2_encoder.engine
      • WEIGHTS_DIR/MobileSAM/mobilesamv2_decoder.engine
      • WEIGHTS_DIR/MobileSAM/ObjectAwareModel.engine
    • torch
      • WEIGHTS_DIR/MobileSAM/Prompt_guided_Mask_Decoder.pt
      • WEIGHTS_DIR/MobileSAM/l2.pt
  • MobileSAMv1:
    • WEIGHTS_DIR/MobileSAM/mobile_sam.pt
  • GroundingDINO:
    • WEIGHTS_DIR/GroundingDINO/groundingdino_swint_ogc.pth

weights_path: WEIGHTS_DIR

Metadata

Release files for ovsegmentation 1.0.41

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for ovsegmentation 1.0.41
File Interpreter ABI Platform Actions
ovsegmentation-1.0.41-py3-none-any.whl Python 3 none any Details for ovsegmentation-1.0.41-py3-none-any.whl

Release files / ovsegmentation-1.0.41-py3-none-any.whl

Download URL ovsegmentation-1.0.41-py3-none-any.whl
Size 755.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d6a985165b6f90969b2d86a11913dc9275bc23ae110bf4c01cf591de9f0c90c7
BLAKE2b-256 checksum
How to use checksums
517264541d0fd8c3a4ff767463a17f424dfe4e8289250adc96f6740f1e382544
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.12

Security for ovsegmentation 1.0.41

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page