OpenImages V6下载

新工具:Fiftyone

网址

可以采用colab运行程序,点击即可:
OpenImages V6下载_第1张图片
完整代码:

!pip install opencv-python-headless==4.5.4.60
!pip install fiftyone

!pip install tensorflow torch torchvision umap-learn
!pip install ipywidgets>=7.5
import fiftyone as fo
import fiftyone.zoo as foz
# 连接谷歌云盘
from google.colab import drive
drive.mount('/content/drive')
# 其中一个示例
dataset = foz.load_zoo_dataset(
    "open-images-v6",
    split="validation",
    label_types=["segmentations", "detections"],
    # classes = ,
    # max_samples=100,
    seed=51,
    shuffle=True,
    dataset_dir="/content/drive/MyDrive/Colab Notebooks/openiamges/",  # 指定下载的数据集保存的路径,尽量不要随意更改,这是保存原始图片的路径,
    dataset_name="open-images",
    # numexpr_max_threads=20,
)

更多示例参考官方示例。
在这里插入图片描述

参数详解:

  • label_types - a list of label types to load. The supported values are (“detections”, “classifications”, “segmentations”, “relationships”). By default, all available labels types will be loaded. Specifying [] will load only the images

  • classes - a list of classes of interest. If specified, only samples with at least one object, segmentation, or image-level label in the specified classes will be downloaded

  • attrs - a list of attributes of interest. If specified, only download samples if they contain at least one attribute in attrs or one class in classes (only applicable when label_types contains “relationships”)

  • load_hierarchy - whether to load the class hierarchy into dataset.info[“hierarchy”]

  • image_ids - an array of specific image IDs to download

  • image_ids_file - a path to a .txt, .csv, or .json file containing image IDs to download

In addition, like all other zoo datasets, you can specify:

  • max_samples - the maximum number of samples to load

  • shuffle - whether to randomly chose which samples to load if max_samples is given

  • seed - a random seed to use when shuffling

你可能感兴趣的:(linux软件安装,数据集,目标检测,目标分割)