/gradio-box

Primary LanguagePythonApache License 2.0Apache-2.0

Gradio Box

This is the advanced gradio used in our paper, GPT4RoI: Instruction Tuning Large Language Model on Region-of-Interest. This is an extension to official gradio, which supports drawing boxes on top of an image. This feature is requested in gradio-app/gradio#2316.

teaser

Usage

See mini-demo:

python app_box.py

Install

1. Install Node.js

We install it on Ubuntu with:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash

source ~/.bashrc # or ~/.zshrc based on which one you use

nvm install v18.16.0

2. Install ppnm

curl -fsSL https://get.pnpm.io/install.sh | sh -

source ~/.bashrc # or ~/.zshrc based on which one you use

pnpm --version  # check if success

3. Install gradio

git clone https://github.com/ShoufaChen/gradio-dev.git

cd gradio-dev

bash scripts/build_frontend.sh

pip install -e .

Common Installation Issues

 ERR_PNPM_FETCH_404  GET https://packagecloud.io/github/git-lfs/npm/whatwg-url/-/whatwg-url-5.0.0.tgz: Not Found - 404 No authorization header was set for the request.
pnpm/pnpm#2933 (comment)
# Add following in `~/.npmrc` file
@OWNER:registry=https://packagecloud.io/github/git-lfs/npm/
ERROR: File "setup.py" not found. Directory cannot be installed in editable mode:
Use pip version >= 23.0.1

Acknowledgement

Our implementation is mainly inspired by gradio-app/gradio#3220, with several modifications for latest gradio. Greate thanks to CtrlAltDeplete.