Code Monkey home page Code Monkey logo

autodistill-sam-hq's Introduction

Autodistill Segment Anything HQ Module

This repository contains the code supporting the Segment Anything base model for use with Autodistill.

SAM HQ is a zero-shot segmentation model capable of producing detailed masks, developed by ETH VIS. SAM HQ can segment an entire image into masks, or use points to segment specific parts of an object. You can use Segment Anything with Autodistill to segment objects. Segment Anything does not assign classes, so you should use SAM HQ model with a tool like Grounding DINO or GPT-4V.

Read the full Autodistill documentation.

Read the SAM HQ Autodistill documentation.

Installation

To use SAM HQ with autodistill, you need to install the following dependency:

pip3 install autodistill-sam-hq

Quickstart

from autodistill_sam_hq import HQSAM

base_model = HQSAM(None)

masks = base_model.predict("./image.jpeg")

print(masks)

License

This project is licensed under an Apache 2.0 license.

๐Ÿ† Contributing

We love your input! Please see the core Autodistill contributing guide to get started. Thank you ๐Ÿ™ to all our contributors!

autodistill-sam-hq's People

Contributors

capjamesg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

autodistill-sam-hq's Issues

Installation issue

Tried demo code in google colab, but it seems to fail as follows:

!pip install autodistill autodistill-grounded-sam autodistill-yolov8
!pip3 install autodistill-sam-hq roboflow supervision

from autodistill_sam_hq import HQSAM
base_model = HQSAM(None)
masks = base_model.predict("eb4c9db3a9b8e3bf6cb8397bc00ad075.png")
print(masks)

ModuleNotFoundError                       Traceback (most recent call last)
[<ipython-input-2-3512cfbd3532>](https://localhost:8080/#) in <cell line: 4>()
      2 get_ipython().system('pip3 install autodistill-sam-hq roboflow supervision')
      3 
----> 4 from autodistill_sam_hq import HQSAM
      5 
      6 base_model = HQSAM(None)

1 frames
[/usr/local/lib/python3.10/dist-packages/autodistill_sam_hq/samhq_model.py](https://localhost:8080/#) in <module>
      7 import supervision as sv
      8 import torch
----> 9 from segment_anything_hq import SamAutomaticMaskGenerator, sam_model_registry
     10 
     11 from autodistill.detection import CaptionOntology, DetectionBaseModel

ModuleNotFoundError: No module named 'segment_anything_hq'

first star

the first star and first issues created with me.
thanks for your codes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.