Giter VIP home page Giter VIP logo

fgvp's Introduction

FGVP: Fine-Grained Visual Prompting

Official Codes for Fine-Grained Visual Prompting, NeurIPS 2023

Install

Our code is built upon ReClip. The installation instructions and the preparation of datasets are the same as the ReClip repository.

FGVP

A Summary of visual prompts with the caption "elephant on the left".

Results

Method VLM Visual Prompt Post Processing Command RefCOCO val RefCOCO+ val RefCOCOg val
CPT-adapted ViT-B/32, RN50x16 $B2$ R link 41.3 41.3 51.3
ReCLIP ViT-B/32, RN50x16 $P{\ | \ }B4$ R link 45.8 47.9 59.3
RedCircle ViT-B/32, RN50x16 $P{\ | \ }C1$ R link 43.9 45.3 57.3
FGVP (ours) ViT-B/32, RN50x16 $P{\ | \ }D4$ R link 52.0 53.3 62.1
RedCircle (reported in paper) ViT-L/14@336px, RN50x16 $C1{\ | \ }C3{\ | \ }C4$ S -- 49.8 55.3 59.4
RedCircle ViT-L/14@336px, RN50x16 $C1{\ | \ }C3{\ | \ }C4$ S link 51.4 56.3 58.3
FGVP (ours) ViT-L/14@336px, RN50x16 $D1{\ | \ }D3{\ | \ }D4$ S link 52.9 57.4 58.1
RedCircle ViT-L/14@336px, RN50x16 $P{\ | \ }C1{\ | \ }C3{\ | \ }C4$ S link 51.6 58.1 60.0
FGVP (ours) ViT-L/14@336px, RN50x16 $P{\ | \ }D1{\ | \ }D3{\ | \ }D4$ S link 53.9 59.3 61.0
RedCircle ViT-L/14@336px, RN50x16 $P{\ | \ }C1{\ | \ }C3{\ | \ }C4$ RS link 56.8 58.6 62.2
FGVP (ours) ViT-L/14@336px, RN50x16 $P{\ | \ }D1{\ | \ }D3{\ | \ }D4$ RS link 59.6 60.0 63.3

Inference Single Image

We simply offer an inference script for a single image without post-processing.

# example 1
python fgvp-reclip/simple_inference.py \
    --img_dir demo/exp1/ori.png \
    --text 'apple on the left' 'apple in the middle' 'broccoli' 'raspberries' 'grossum' 'glass bowl' \
    --out_dir demo/exp1 \
    --sam_prompt grid

# example 2
python fgvp-reclip/simple_inference.py \
    --img_dir demo/exp2/ori.png \
    --out_dir demo/exp2 \
    --text 'photo on the wall' \
    --sam_prompt grid

You can provide proposal boxes derived from other detectors to achieve better localization. Save your bounding boxes in a JSON file and specify it with --candidate_boxes.

# example
python fgvp-reclip/simple_inference.py \
    --img_dir demo/exp1/ori.png \
    --text 'apple on the left' 'apple in the middle' 'broccoli' 'raspberries' 'grossum' 'glass bowl' \
    --out_dir demo/exp1 \
    --sam_prompt box \
    --candidate_boxes demo/exp1/candidate_boxes.json

fgvp's People

Contributors

ylingfeng avatar

Stargazers

Jinyuan Li avatar yrl-pris avatar YOLO avatar zhaozh10 avatar  avatar  avatar jpy.cas avatar Min Jeong Park avatar Jiaxiong Yang avatar  avatar Vladyslav Khramtsov avatar  avatar wangxinliang avatar  avatar Gaozong avatar Zhixing Sun avatar Chauncey avatar  avatar  avatar dai ming avatar wenjie zhu avatar  avatar Jeff Carpenter avatar linyu avatar  avatar Zheng Li avatar

Watchers

Kostas Georgiou avatar  avatar

fgvp's Issues

Inference code for a prompt + single image as input

Hello ๐Ÿ‘‹

I just found out your repository, nice work !
I was wondering if there was a quick way to do some inference on a single image with a prompt to assess the results on randomly picked images ๐Ÿ˜ƒ

Thanks !

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.