voxel51 / voxelgpt

AI assistant that can query visual datasets, search the FiftyOne docs, and answer general computer vision questions
https://gpt.fiftyone.ai
Apache License 2.0
234 stars 17 forks source link

ChatGPT plugin #25

Closed brimoor closed 1 year ago

brimoor commented 1 year ago

Setup

pip install openai langchain chromadb pandas
export OPENAI_API_KEY=XXXXXXXX

# Install plugin (run from within your clone of this repo)
ln -s "$(pwd)" "$(fiftyone config plugins_dir)/fiftyone-gpt"

Example ask_gpt operator usage

Run the ask_gpt operator from the App:

import fiftyone as fo
import fiftyone.zoo as foz

dataset = foz.load_zoo_dataset("quickstart")
session = fo.launch_app(dataset)

https://github.com/voxel51/fiftyone-gpt/assets/25985824/8af6826f-1272-413f-8456-7ac222c40b79

Example ask_gpt_interactive usage

import fiftyone as fo
import fiftyone.zoo as foz

from gpt_view_generator import ask_gpt_interactive

dataset = foz.load_zoo_dataset("quickstart")
session = fo.launch_app(dataset)
ask_gpt_interactive(dataset, session=session)
# How can I help you? show me 10 random samples
Identified potential view stages: ['limit', 'skip', 'take', 'match', 'sort_by_similarity']
Okay, I'm going to load dataset.take(10)