GithubHelp home page GithubHelp logo

autodistill / autodistill-detic Goto Github PK

View Code? Open in Web Editor NEW
11.0 3.0 2.0 24 KB

DETIC module for use with Autodistill.

Home Page: https://docs.autodistill.com

License: MIT License

Makefile 11.63% Python 88.37%
autodistill computer-vision detic

autodistill-detic's Introduction

Autodistill DETIC Module

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

DETIC is a transformer-based object detection and segmentation model developed by Meta Research.

Read the full Autodistill documentation.

Read the DETIC Autodistill documentation.

Installation

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

pip3 install autodistill-detic

Quickstart

from autodistill_detic import DETIC

# define an ontology to map class names to our DETIC prompt
# the ontology dictionary has the format {caption: class}
# where caption is the prompt sent to the base model, and class is the label that will
# be saved for that caption in the generated annotations
# then, load the model
base_model = DETIC(
    ontology=CaptionOntology(
        {
            "person": "person",
        }
    )
)
base_model.label("./context_images", extension=".jpg")

License

The code in this repository is licensed under an MIT license.

See the Meta Research DETIC repository for more information on the DETIC license.

๐Ÿ† Contributing

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

autodistill-detic's People

Contributors

artyaltanzaya avatar capjamesg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

autodistill-detic's Issues

Unable to see the result:

Hello,

When I try the DETIC model. I do not see any result : It seems labelled images are zero.

person
Loading pretrained CLIP
/media/csverma/M2Disk/Projects/CompVis/ObjectDetection/AutoDistill/autodistillenv/lib/python3.11/site-packages/torch/functional.py:504: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at ../aten/src/ATen/native/TensorShape.cpp:3526.)
return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined]
[10/07 11:40:22 fvcore.common.checkpoint]: [Checkpointer] Loading from models/Detic_LCOCOI21k_CLIP_SwinB_896b32_4x_ft4x_max-size.pth ...
Labeling images: 0it [00:00, ?it/s]
Labeled dataset created - ready for distillation.

Documentation

Hello,

Most likely, this package may need a more description about the installation steps. I installed Detic in the last and all the code
were installed and working.

However for the Detic. I got the following error on M1:
Collecting git+https://github.com/facebookresearch/detectron2.git
Cloning https://github.com/facebookresearch/detectron2.git to /private/var/folders/kb/dq9v0bpn67gb64fkjtrvs38c0000gn/T/pip-req-build-id_gecv7
Running command git clone --filter=blob:none --quiet https://github.com/facebookresearch/detectron2.git /private/var/folders/kb/dq9v0bpn67gb64fkjtrvs38c0000gn/T/pip-req-build-id_gecv7
Resolved https://github.com/facebookresearch/detectron2.git to commit 337ca3490fa7879ceeeadf6c2b73d67504ff4b4f
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error

ร— Getting requirements to build wheel did not run successfully.
โ”‚ exit code: 1
โ•ฐโ”€> [20 lines of output]
Traceback (most recent call last):
File "/Users/csv610/Projects/CompVis/ObjectDetection/AutoDistill/autodistillenv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in
main()
File "/Users/csv610/Projects/CompVis/ObjectDetection/AutoDistill/autodistillenv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/csv610/Projects/CompVis/ObjectDetection/AutoDistill/autodistillenv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
^^^^^^^^^^^^^^^^^^^^^
File "/private/var/folders/kb/dq9v0bpn67gb64fkjtrvs38c0000gn/T/pip-build-env-1v2q37ui/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 355, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/private/var/folders/kb/dq9v0bpn67gb64fkjtrvs38c0000gn/T/pip-build-env-1v2q37ui/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 325, in _get_build_requires
self.run_setup()
File "/private/var/folders/kb/dq9v0bpn67gb64fkjtrvs38c0000gn/T/pip-build-env-1v2q37ui/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 507, in run_setup
super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
File "/private/var/folders/kb/dq9v0bpn67gb64fkjtrvs38c0000gn/T/pip-build-env-1v2q37ui/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 341, in run_setup
exec(code, locals())
File "", line 10, in
ModuleNotFoundError: No module named 'torch'
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

ร— Getting requirements to build wheel did not run successfully.
โ”‚ exit code: 1
โ•ฐโ”€> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
Traceback (most recent call last):
File "/Users/csv610/Projects/CompVis/ObjectDetection/AutoDistill/DETIC/autodistill-detic/genlabels.py", line 1, in
from autodistill_detic import DETIC
File "/Users/csv610/Projects/CompVis/ObjectDetection/AutoDistill/DETIC/autodistill-detic/autodistill_detic/init.py", line 1, in
from autodistill_detic.detic_model import DETIC
File "/Users/csv610/Projects/CompVis/ObjectDetection/AutoDistill/DETIC/autodistill-detic/autodistill_detic/detic_model.py", line 96, in
from detectron2.config import get_cfg
ModuleNotFoundError: No module named 'detectron2'
(autodistillenv) $

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.