1. 支持的数据集
1.1. 支持各种常见的数据集格式
- docs.voxel51.com/user guide/dataset creation/datasets.html#supported import formats
 
- 此外,zoo上面有什么数据集,这里就可以加载到对应的数据集
- Available Zoo Datasets — FiftyOne 0.20.1 documentation
 
2. 从云端下载数据集
2.1. 可视化COCO数据集
2.1.1. 从浏览器中打开
import fiftyone as fo
import fiftyone.zoo as foz
加载官方数据集coco2017,因为训练集太大,所以我们只下载验证集
dataset = foz.load_zoo_dataset(
    "coco-2017",
    split="validation",
    dataset_name="evaluate-detections-tutorial",
)
通过fo来打开app可视化:
session = fo.launch_app() 打开APP
session.dataset = dataset 添加数据集
session.wait()  官网给的示例没有这一句,记得加上,不然程序不会等待,在网页中看不到我们要的效果
2.1.2. 在APP中打开操作页面
代码
import fiftyone as fo
import fiftyone.zoo as foz
dataset = foz.load_zoo_dataset("quickstart")
session = fo.launch_app(dataset,port = 5151,desktop=True)  # 没有指定port则默则5151
session.wait()  # 官网给的示例没有这一句,记得加上,不然程序不会等待,在网页中看不到我们要的效果

- 读取 cifar10 数据集
代码
import fiftyone as fo
import fiftyone.zoo as foz
# 加载官方数据集coco2017,因为训练集太大,所以我们只下载验证集
dataset = foz.load_zoo_dataset(
    "cifar10",
    split="test",
    dataset_name="evaluate-detections-tutorial",
)
# 通过fo来打开app可视化:
session = fo.launch_app() # 打开APP
session.dataset = dataset # 添加数据集
session.wait()  # 官网给的示例没有这一句,记得加上,不然程序不会等待,在网页中看不到我们要的效果
3. 读取自定义格式数据集
3.1. 可视化VOC数据集
- docs.voxel51.com/user guide/dataset creation/datasets.html#vocdetectiondataset import
3.1.1. 格式要求
vc格式的数据仅需要将图像放在data文件夹下,然后将标签放在labels文件夹下
<dataset_dir>/
    data/
        <uuid1>.<ext>
        <uuid2>.<ext>
        ...
    labels/
        <uuid1>.xml
        <uuid2>.xml
        ...
3.1.2. 代码
读取整个数据集文件夹
import fiftyone as fo
# A name for the dataset
name = "my-dataset"
# The directory containing the dataset to import
dataset_dir = "dataset/RBC"
# The type of the dataset being imported
dataset_type = fo.types.VOCDetectionDataset  # for example
dataset = fo.Dataset.from_dir(
    dataset_dir=dataset_dir,
    dataset_type=dataset_type,
    name=name,
)
session = fo.launch_app() # 打开APP
session.dataset = dataset # 添加数据集
session.wait()  # 官网给的示例没有这一句,记得加上,不然程序不会等待,在网页中看不到我们要的效果
指定图像和标注的路径
import fiftyone as fo
name = "my-dataset-1"
data_path = "dataset/RBC/data"
labels_path = "dataset/RBC/labels"
dataset = fo.Dataset.from_dir(
    dataset_type=fo.types.VOCDetectionDataset,
    data_path=data_path,
    labels_path=labels_path,
    name=name,
)
session = fo.launch_app() # 打开APP
session.dataset = dataset # 添加数据集
session.wait()  # 官网给的示例没有这一句,记得加上,不然程序不会等待,在网页中看不到我们要的效果
3.1.3. 效果


 
 


















