Open vocabulary detection and segmentation package
Project description
Open vocabulary segmentation
Models
- GroundingDINO
- MobileSAMv2
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)
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:
- WEIGHTS_DIR/MobileSAMv2/l2_encoder.engine
- WEIGHTS_DIR/MobileSAMv2/mobilesamv2_decoder.engine
- WEIGHTS_DIR/MobileSAMv2/ObjectAwareModel.engine
- WEIGHTS_DIR/GroundingDINO/groundingdino_swint_ogc.pth
weights_path: WEIGHTS_DIR
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for ovsegmentation-1.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fced2443a69ae325e6c93d66ec0bb99e3637526fb3c000a3ccf298311f7efaa8 |
|
MD5 | 35920acc21140c43fa0af5f3955af735 |
|
BLAKE2b-256 | f65306e2abcc85e9675e385204ca90ff2e8277b511d3b8f56c5342a32f442108 |