VoxelGPT:计算机视觉的AI助手

ChatGPT中文站

想要在不编写代码的情况下揭示有趣的图像和视频数据集的见解吗?现在,使用 VoxelGPT 就可以实现!

VoxelGPT 将大型语言模型(LLMs)的能力与FiftyOne的灵活的计算机视觉查询语言相结合,使计算机视觉数据集的语义切片和构建更好的机器学习模型变得比以往任何时候都更容易。

这一突破让您能够通过自然语言对数据实现史无前例的控制。您可以对图像和视频数据集进行筛选,发现新的洞察力,成为更好的计算机视觉工程师,而无需编写任何代码!

是的,你没看错:VoxelGPT 可以将你的英语查询翻译成 Python 代码,用于过滤你的数据集!

更好的是,VoxelGPT是完全开源且免费使用的。代码位于https://github.com/voxel51/voxelgpt,您可以在gpt.fiftyone.ai上实时尝试使用。想在自己的数据上本地使用VoxelGPT吗?您可以在本地安装插件(请继续阅读获取说明)。

VoxelGPT 是什么?

VoxelGPT是一款采用FiftyOne、GPT-3.5和LangChain技术构建的LLM应用程序。VoxelGPT提供了类似聊天的界面,通过将自然语言查询翻译成FiftyOne Python语法并构建相应的DatasetView来与你的计算机视觉数据集进行交互。

这是一个游戏改变者,因为掌握FiftyOne查询语言及其所有的灵活性可能有一个陡峭的学习曲线。使用VoxelGPT,你可以立即运用FiftyOne的全部功能来进行语义切片,而不需要任何对查询语言的先前了解。

此外,VoxelGPT 还可以回答特定的FiftyOne使用问题和更广泛的机器学习问题。

你可以通过简单的Python API来使用VoxelGPT,或者通过将其作为FiftyOne插件安装,直接在FiftyOne应用程序中本地使用VoxelGPT!

请在 gpt.fiftyone.ai 上亲自尝试 VoxelGPT。

VoxelGPT 不会为您完成计算机视觉工作,但肯定可以提高您的速度和效率。它是一种合作编程工具,一个翻译器,也是一个教育工具。

VoxelGPT的能力

VoxelGPT 可以处理以下任何类型的查询:

  • 数据集查询
  • FiftyOne文档查询
  • 常见的计算机视觉问题

当您询问VoxelGPT问题时,它会解释您的意图,并确定您正在询问哪种类型的查询。如果VoxelGPT不确定,它会要求您澄清。

数据集查询

它是如何工作的?VoxelGPT将解释您的查询,将其翻译成FiftyOne查询语言Python代码,并显示结果视图。它知道如何处理样本为图像或视频的数据集,并且完全支持基于其开发的示例集的单阶段和双阶段查询。

当解释您的查询时,VoxelGPT将会执行以下操作:

  • 识别字段和类名:VoxelGPT能够根据自然语言查询和特定数据集的信息选择适当的字段和类名。它使用命名实体识别来识别字段和类名,对于少于1,000个类的字段,使用语义匹配来匹配类名。
  • 推断相关计算:VoxelGPT 确定大脑运行或评估运行对自然语言查询可能是相关的,并且如果是,自动选择相关运行。
  • 打印有用信息:如果 VoxelGPT 确定计算可能需要在数据集上运行,或者查询不包含转换为 ViewStages 所需的所有信息,它将回复带有指示的消息。

以下是您可以向VoxelGPT提出的数据集查询示例-在gpt.fiftyone.ai上尝试实时运行它们:

  • 检索10个随机样本。
  • 展示最独特的图像,带有假阳性预测。
  • 只显示至少检测到两个人且置信度高的图片
  • 展示与第一张含有狗的图片最相似的25张照片。

FiftyOne文档查询

VoxelGPT 不仅是一对程序员,也是一个教育工具。该模型可以访问整个 FiftyOne 文档,包括教程、用户指南和 API 参考,并使用这些信息来回答您的问题。

以下是您可以向VoxelGPT提出的文档查询示例:

  • 如何从FiftyOne Zoo加载数据集?
  • 文档:match() 阶段是做什么的?
  • 我能以COCO格式导出我的数据集吗?

通过轻松切换数据集查询和文档查询,您可以使用VoxelGPT更好地了解FiftyOne查询语言的工作原理。

常见的计算机视觉问题查询

VoxelGPT也可以回答在计算机视觉、机器学习和数据科学领域的一般性问题,帮助你理解基本概念,并克服数据质量问题。

以下是您可以向 VoxelGPT 发出的计算机视觉查询的一些示例:

  • 什么是精确度和召回率的区别?
  • 如何在我的图像中检测人脸?
  • 我有哪些方法可以减少数据集中的冗余?

VoxelGPT不能做什么

虽然 VoxelGPT 很强大,但我们有意限制了它的范围,以提供集中的用户体验,同时为未来高价值升级留下空间。

VoxelGPT目前无法:

  • 进行一般性对话:VoxelGPT 不是通用的聊天机器人。如果您的问题被认为不在范围内,VoxelGPT 将提示您提出新的问题。
  • 执行计算:一些计算,如生成向量相似度指数,可能耗费大量时间和精力。我们尚未授予VoxelGPT代表您执行这些计算的能力,但VoxelGPT会识别出何时需要运行这些计算,并告知您相关信息。
  • 永久操作:同样地,VoxelGPT 无法永久更改您的数据-例如,它无法从底层数据集中删除样本,复制数据集或移动任何媒体文件的位置。
  • 委派任务:目前,VoxelGPT没有任何类似HuggingGPT的分派能力。它不能将计算机视觉任务委派给其他ML模型。

普遍性和反馈

VoxelGPT 目前的实现基于有限的一组示例,因此可能无法推广到所有数据。您的查询越具体,结果越好。如果您有更复杂的任务,请尝试将其拆分为多个自然语言查询,并结合 VoxelGPT 的结果。

我们很想听听您对VoxelGPT在您的使用情况下的表现。欢迎报告错误、提出功能请求以及VoxelGPT揭示的惊人发现。请给我们留言!

开动起来

现场演示

如果你想体验VoxelGPT并亲身感受这个模型将自然语言转化为计算机视觉洞察的过程,请在gpt.fiftyone.ai上查看实时演示,你可以在FiftyOne应用程序中的一些示例数据集中本地使用VoxelGPT。

本地安装VoxelGPT

您还可以通过Python编程与VoxelGPT进行交互,并按照以下说明在本地安装,以便使用自己的数据集。

安装FiftyOne

如果您还没有安装FiftyOne,请先安装:

pip install fiftyone

提供OpenAI API密钥。

接下来提供一个OpenAI API密钥:

export OPENAI_API_KEY=XXXXXXXX

如果您没有OpenAI密钥,您需要创建一个。

在 OpenAI 的 API 调用中,一个查询通常只需要 $0.01。

仅限应用使用

现在,如果你只想在FiftyOne应用程序中使用VoxelGPT,你可以通过运行以下命令将其安装为插件:

fiftyone plugins download https://github.com/voxel51/voxelgpt 
fiftyone plugins requirements @voxel51/voxelgpt --install

Python使用

或者,如果您想以编程方式与VoxelGPT交互,或者想为项目做出贡献,那么请克隆voxelgpt存储库:

git clone https://github.com/voxel51/voxelgpt 
cd voxelgpt

并安装要求:

pip install -r requirements.txt

为了使插件在FiftyOne应用程序中也可用,您可以将其符号链接到FiftyOne插件目录中:

ln -s "$(pwd)" "$(fiftyone config plugins_dir)/voxelgpt"

在应用程序中使用 VoxelGPT

使用已安装的VoxelGPT插件,您可以在任何数据集中原生地在FiftyOne应用程序中使用它:

import fiftyone as fo
import fiftyone.zoo as foz

## load quickstart dataset.
## -- If you want to load another dataset from the Zoo,
## -- Ask VoxelGPT: "what datasets are in the FiftyOne Dataset Zoo?"

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

在FiftyOne 应用程序中,简单地:

  • 单击格子上方的OpenAI图标,或
  • 点击"样本"标签旁边的"+"图标,选择"VoxelGPT"。

专业提示:使用now关键字将您之前的提示作为上下文,以供下一个查询使用!

在Python中使用VoxelGPT

如果您选择进行Python/开发安装,您也可以在Python中以编程方式与VoxelGPT交互。

交互模式

您可以通过ask_voxelgpt_interactive()使用VoxelGPT的交互模式。在交互模式下,您可以通过input()提示与VoxelGPT进行交互。

要开始,只需传入一个数据集和一个应用程序会话:

import fiftyone as fo
import fiftyone.zoo as foz

from voxelgpt import ask_voxelgpt_interactive

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

ask_voxelgpt_interactive(dataset, session=session)

通常情况下,您可以使用数据集、文档和通用计算机视觉查询的任何组合来提示VoxelGPT。例如,对话可能如下所示:

You:

what is the difference between precision and recall?

VoxelGPT:

Precision and recall are two important metrics used to evaluate the
performance of a machine learning model in classification tasks. Precision
measures the proportion of true positive predictions among all positive
predictions made by the model. Recall, on the other hand, measures the
proportion of true positive predictions among all actual positive instances
in the dataset.

In other words, precision is the ability of the model to correctly identify
positive instances, while recall is the ability of the model to identify
all positive instances. A high precision means that the model is making
very few false positive predictions, while a high recall means that the
model is able to identify most of the positive instances in the dataset.

It is important to balance precision and recall when evaluating a model's
performance. A model with high precision but low recall may be missing
important positive instances, while a model with high recall but low
precision may be making too many false positive predictions.

In the context of the FiftyOne library, precision and recall can be
computed using the `fiftyone.utils.metrics` module, which provides
functions for computing various classification metrics. For example, the
`fiftyone.utils.metrics.binary_classification` function can be used to
compute precision and recall for binary classification tasks.

You:

does FiftyOne integrate with Label Studio?

VoxelGPT:

Yes, FiftyOne integrates with Label Studio, which is an open-source data
labeling tool with a user-friendly UI. The integration allows you to easily
upload your data directly from FiftyOne to Label Studio for labeling. You
can get started with Label Studio through a simple pip install to get a
local server up and running. FiftyOne provides simple setup instructions
that you can use to specify the necessary account credentials and server
endpoint to use. FiftyOne also provides an API to create projects, upload
data, define label schemas, and download annotations using Label Studio,
all programmatically in Python.

You:

show me predicted airplanes

VoxelGPT:

Identified potential algorithms: evaluation
No evaluation runs found.
Identified potential fields: predictions
Identified potential label classes: {'predictions': ['airplane']}
Identified potential view stages: ['match', 'filter_labels', 'match_labels', 'exclude_labels', 'filter_field']
Okay, I'm going to load dataset.filter_labels("predictions",F("label") == "airplane")

You:

now only show me the first 10 samples

VoxelGPT:

Identified potential algorithms: evaluation
No evaluation runs found.
Identified potential fields: predictions
Identified potential label classes: {'predictions': ['airplane']}
Identified potential view stages: ['match', 'limit', 'limit_labels', 'skip', 'sort_by']
Okay, I'm going to load dataset.match(F("predictions.detections.label").contains("airplane")).limit(10)

You: exit

在交互模式下,VoxelGPT自动加载其在应用程序中创建的任何视图,并且您可以通过会话对象访问它们:

print(session.view.count("predictions.detections"))

单查询模式

如果您只想运行一个单一查询,您可以使用ask_voxelgpt()函数:

from voxelgpt import ask_voxelgpt 
ask_voxelgpt("Does FiftyOne integrate with CVAT?")
Yes, FiftyOne integrates with CVAT, which is an open-source image and video
annotation tool. You can upload your data directly from FiftyOne to CVAT to
add or edit labels. FiftyOne provides simple setup instructions that you can
use to specify the necessary account credentials and server endpoint to use.
CVAT provides three levels of abstraction for annotation workflows: projects,
tasks, and jobs.

如果您在查询时传递了一个数据集,并且VoxelGPT将您的提示解释为加载数据集视图的请求,它将返回给您:

import fiftyone as fo
import fiftyone.zoo as foz

dataset = foz.load_zoo_dataset("quickstart")
view = ask_voxelgpt("show me 10 random samples", dataset)

从那里,您可以像处理其他FiftyOne数据集视图一样与其交互或进一步调整视图。

num_objects = view.count_values("ground_truth.detections.label")

结论

VoxelGPT将大型语言模型的功能带到您的计算机视觉数据集中。它完全开源,您今天可以在gpt.fiftyone.ai上尝试它!

如果您喜欢VoxelGPT,请考虑在GitHub上给voxelgpt点个赞。而且,顺便也给Fiftyone点个赞吧;这些都是开源的!我们感谢您的支持?

加入FiftyOne社群

加入数千名工程师和数据科学家的行列,使用FiftyOne解决当今计算机视觉中一些最具挑战性的问题!

  • 1,700+ FiftyOne Slack 成员
  • 3,000+ GitHub 上的星标
  • 4,200+ Meetup成员
  • 被300多个储存库使用
  • 60多名贡献者

2023-10-20 16:43:37 AI中文站翻译自原文