我向 FiftyOne 持久数据集添加了示例标签(“train”、“test”、“val”),如此处的示例所示:https://docs.voxel51.com/api/fiftyone.utils.random。 html(
# Generate a random sample and encode results via tags
)。
dataset = fo.load_dataset(dataset_name)
view = (dataset.match(F("max_similarity") < 0.9))
four.random_split(view, {"train": 0.7,
"test": 0.2,
"val": 0.1})
但是,我在比例上犯了错误,想删除这些标签。
我在 FiftyOne 文档中找到了一些有关取消数据集标记的内容 https://docs.voxel51.com/api/fiftyone.core.clips.html?highlight=untag#fiftyone.core.clips.ClipsView.untag_labels.
我尝试了
view.untag_labels("train")
,并预计标签会消失,但根据 FiftyOne 桌面应用程序,它仍然在这里:
这是我编写的删除标签的代码:
dataset = fo.load_dataset(dataset_name)
view = (dataset.match(F("max_similarity") < 0.9))
view.untag_labels("train", "sample tags")
view.untag_labels("val", "sample tags")
view.untag_labels("test", "sample tags")
我也尝试过
view.untag_labels("train")
、view.tags.pop()
和dataset.untag_labels("train")
。
提前感谢您的回答!
我在文档中找到了答案:https://docs.voxel51.com/api/fiftyone.core.clips.html#fiftyone.core.clips.ClipsView.untag_samples
view.untag_samples("train")