{"id":18858755,"url":"https://github.com/autodistill/autodistill-codet","last_synced_at":"2025-09-03T17:32:49.444Z","repository":{"id":205091721,"uuid":"713111919","full_name":"autodistill/autodistill-codet","owner":"autodistill","description":"CoDet base model for use with Autodistill.","archived":false,"fork":false,"pushed_at":"2024-04-03T16:21:47.000Z","size":38,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-30T04:30:59.311Z","etag":null,"topics":["autodistill","codet","computer-vision","object-detection","zero-shot-object-detection"],"latest_commit_sha":null,"homepage":"https://docs.autodistill.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/autodistill.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-01T21:30:06.000Z","updated_at":"2025-04-08T22:40:49.000Z","dependencies_parsed_at":"2024-11-08T04:14:41.686Z","dependency_job_id":null,"html_url":"https://github.com/autodistill/autodistill-codet","commit_stats":null,"previous_names":["autodistill/autodistill-codet"],"tags_count":0,"template":false,"template_full_name":"autodistill/autodistill-base-model-template","purl":"pkg:github/autodistill/autodistill-codet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autodistill%2Fautodistill-codet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autodistill%2Fautodistill-codet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autodistill%2Fautodistill-codet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autodistill%2Fautodistill-codet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/autodistill","download_url":"https://codeload.github.com/autodistill/autodistill-codet/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autodistill%2Fautodistill-codet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273480991,"owners_count":25113495,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-03T02:00:09.631Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autodistill","codet","computer-vision","object-detection","zero-shot-object-detection"],"created_at":"2024-11-08T04:14:37.027Z","updated_at":"2025-09-03T17:32:49.124Z","avatar_url":"https://github.com/autodistill.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cp\u003e\n    \u003ca align=\"center\" href=\"\" target=\"_blank\"\u003e\n      \u003cimg\n        width=\"850\"\n        src=\"https://media.roboflow.com/open-source/autodistill/autodistill-banner.png\"\n      \u003e\n    \u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n# Autodistill CoDet Module\n\nThis repository contains the code supporting the CoDet base model for use with [Autodistill](https://github.com/autodistill/autodistill).\n\n[CoDet](https://github.com/CVMI-Lab/CoDet) is an open vocabulary zero-shot object detection model. The model was described in the \"CoDet: Co-Occurrence Guided Region-Word Alignment for Open-Vocabulary Object Detection\" published by Chuofan Ma, Yi Jiang, Xin Wen, Zehuan Yuan, Xiaojuan Qi. The paper was submitted to NeurIPS2023.\n\nRead the full [Autodistill documentation](https://autodistill.github.io/autodistill/).\n\nRead the [CoDet Autodistill documentation](https://autodistill.github.io/autodistill/base_models/codet/).\n\n## Installation\n\nTo use CoDet with autodistill, you need to install the following dependency:\n\n```bash\npip3 install autodistill-codet\n```\n\n## Quickstart\n\nWhen you first run the model, it will download CoDet and its dependencies, as well as the required model configuration and weights. The output during the download process will be verbose. If you stop the download process before it has finished, run `rm -rf ~/.cache/autodistill/CoDet` before running the model again. This ensures that you don't work from a part-installed CoDet setup.\n\nWhen the `predict()` function runs, the output will also be verbose. You can ignore the output printed to the console that appears when you call `predict()`.\n\nYou can only predict classes in the LVIS vocabulary. You can see a list of supported classes in the `class_names.json` file in the [autodistill-codet GitHub repository](https://github.com/autodistill/autodistill-codet).\n\nUse the code snippet below to get started:\n\n```python\nfrom autodistill_codet import CoDet\nfrom autodistill.detection import CaptionOntology\nfrom autodistill.utils import plot\nimport cv2\n\n# define an ontology to map class names to our CoDet prompt\n# the ontology dictionary has the format {caption: class}\n# where caption is the prompt sent to the base model, and class is the label that will\n# be saved for that caption in the generated annotations\n# then, load the model\nbase_model = CoDet(\n    ontology=CaptionOntology(\n        {\n            \"person\": \"person\"\n        }\n    )\n)\n\n# run inference on an image and display the results\n# class_names is a list of all classes supported by the model\n# class_names can be used to turn the class_id values from the model into human-readable class names\n# class names is defined in self.class_names\npredictions = base_model.predict(\"./context_images/1.jpeg\")\nimage = cv2.imread(\"./context_images/1.jpeg\")\n\nplot(\n  image=image,\n  detections=predictions,\n  classes=base_model.class_names\n)\n\n# run inference on a folder of images and save the results\nbase_model.label(\"./context_images\", extension=\".jpeg\")\n```\n\n\n## License\n\nThis project is licensed under an [Apache 2.0 license](LICENSE), except where files explicitly note a license.\n\n## 🏆 Contributing\n\nWe love your input! Please see the core Autodistill [contributing guide](https://github.com/autodistill/autodistill/blob/main/CONTRIBUTING.md) to get started. Thank you 🙏 to all our contributors!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fautodistill%2Fautodistill-codet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fautodistill%2Fautodistill-codet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fautodistill%2Fautodistill-codet/lists"}