我使用51将数据集转换为coco格式,并导出json文件,但是,当我将数据集加载到python中的51数据集以便以后可视化时,我将得到以下错误: TypeError:call()获得了参数'name‘的多个值。有什么想法吗?
import fiftyone as fo
import fiftyone.zoo as foz
# Load raw images into FiftyOne
dataset = fo.Dataset.from_dir(
"/path/to/image_dir",
dataset_type=fo.types.ImageDirectory,
name="my_dataset"
)
# Load a model and generate predictions
model = foz.load_zoo_model("ssd-mobilenet-v1-fpn-coco-tf")
dataset.apply_model(model, label_field="predictions")
# Export labeled dataset in COCO format
dataset.export(
export_dir="/path/to/dataset",
dataset_type=fo.types.COCODetectionDataset,
label_field="predictions",
)
dataset = fo.Dataset(
"/path/to/dataset_dir",
dataset_type=fo.types.COCODetectionDataset,
name="my_dataset"
)发布于 2022-06-04 20:13:54
您似乎试图用name关键字参数覆盖name="my_dataset"位置参数的值。为求澄清:
dataset = fo.Dataset(
"/path/to/dataset_dir", # this is the positional `name` argument
dataset_type=fo.types.COCODetectionDataset,
name="my_dataset" # this is the keyword `name` argument
)https://stackoverflow.com/questions/72502827
复制相似问题