我正在使用Pytorch和51处理图像检测,然后像这样的人将这些图像检测可视化:

但是,我很难以一种容易理解的方式来保存它。我希望能够保存通过脚本覆盖在图像上的边界框处理的图像,这只能通过右键单击并从上面的应用程序下载图像来实现。FiftyOne为导出数据提供了多个选项:https://voxel51.com/docs/fiftyone/user_guide/export_datasets.html#supported-formats,但所有这些都导出检测以供在另一个脚本中使用(通过将图像和检测分别保存在..txt/..json/etc文件中),而不是“最终可视化”映像。如何使用FiftyOne保存您在上面看到的图像(包括检测框)?如果没有内置方法,我可以将其导出到另一种类型的数据集并保存检测结果吗?
发布于 2021-12-02 14:42:07
FiftyOne具有内置的功能,允许您在样本上绘制标签,并将它们保存到磁盘中,用于任何数据集、视图,甚至是单个示例:https://voxel51.com/docs/fiftyone/user_guide/draw_labels.html。
一般来说,它可以简单到:
import fiftyone as fo
# The Dataset or DatasetView containing the samples you wish to draw
dataset_or_view = fo.Dataset(...)
# The directory to which to write the annotated media
output_dir = "/path/for/output"
# The list of `Label` fields containing the labels that you wish to render on
# the source media (e.g., classifications or detections)
label_fields = ["ground_truth", "predictions"] # for example
# Render the labels!
dataset_or_view.draw_labels(output_dir, label_fields=label_fields)draw_labels()方法还接受一个DrawConfig,它为在绘制标签时如何呈现标签提供了许多选项。
https://stackoverflow.com/questions/70190686
复制相似问题