Code Monkey home page Code Monkey logo

detgpt's Introduction

DetGPT: Detect What You Need via Reasoning

Demo Project Code License Python 3.9+ Embark slack badge WeChat badge

News

  • [2023-06-13] Added tuned linear weights for Vicuna-7b.
  • [2023-05-25] Our paper is available at this link.
  • [2023-05-09] We have launched our project website.
  • [2023-05-08] The first version of DetGPT is available now! Try our demo.

Online Demo

Due to high website traffic, we have created multiple online services. If one link is not working, please use another one. Thank you for your support!

Demo

演示 (简体中文)

Demo (backup)

Examples

ex1
ex5
ex3

Features

DetGPT

  • DetGPT locates target objects, not just describing images.
  • DetGPT understands complex instructions, like "Find blood pressure-reducing foods in the image."
  • DetGPT accurately localizes target objects via LLM reasoning. - For example, it can identify bananas as a potassium-rich food to alleviate high blood pressure.
  • DetGPT provides answers beyond human common sense, like identifying unfamiliar fruits rich in potassium.

Setup

1. Installation

git clone https://github.com/OptimalScale/DetGPT.git
cd DetGPT
conda create -n detgpt python=3.9 -y
conda activate detgpt
pip install -e .

2. Install GroundingDino

python -m pip install -e GroundingDINO

2. Download the pretrained checkpoint

Our model is based on pretrained language model checkpoints. In our experiments, we use Robin from LMFlow team, and Vicuna and find they perform competitively well. You can run following script to download the Robin checkpoint:

cd output_models
bash download.sh all
cd -

Merge the robin lora model with the original llama model and save the merged model to output_models/robin-7b, where the corresponding model path is specified in this config file here.

To obtain the original llama model, one may refer to this doc. To merge a lora model with a base model, one may refer to PEFT or use the merge script provided by LMFlow.

Training

The code will be released soon.

Deploy Demo Locally

Run the demo by executing the following command. Replace 'path/to/pretrained_linear_weights' in the config file to the real path. We currently release linear weights based on Vicuna-13B-v1.1 and will release other weights later. The demo runs on 2 GPUs by default, one for the language model and another for GroundingDino.

CUDA_VISIBLE_DEVICES=0,1 python demo_detgpt.py --cfg-path configs/detgpt_tasktune_13b_coco.yaml

Acknowledgement

The project is built on top of the amazing open-vocabulary detector GroundingDino and multimodal conversation model MiniGPT-4, which is based on BLIP2 and Lavis. Thanks for these great work!

If you're using DetGPT in your research or applications, please cite using this BibTeX:

@misc{pi2023detgpt,
      title={DetGPT: Detect What You Need via Reasoning}, 
      author={Renjie Pi and Jiahui Gao and Shizhe Diao and Rui Pan and Hanze Dong and Jipeng Zhang and Lewei Yao and Jianhua Han and Hang Xu and Lingpeng Kong and Tong Zhang},
      year={2023},
      eprint={2305.14167},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}

License

This repository is released under BSD 3-Clause License.

detgpt's People

Contributors

pipilurj avatar sumilergao avatar shizhediao avatar

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.