FiftyOne cung cấp hỗ trợ gốc để nhập tập dữ liệu từ đĩa ở nhiều định dạng khác nhau và có thể dễ dàng mở rộng để nhập tập dữ liệu ở định dạng Show
Ghi chú Nếu dữ liệu của bạn ở định dạng tùy chỉnh, đây là cách dễ nhất để tải dữ liệu của bạn vào FiftyOne công thức cơ bảnGiao diện để tạo FiftyOne cho dữ liệu của bạn trên đĩa được hiển thị thuận tiện thông qua thư viện Python và CLI. Công thức cơ bản là bạn chỉ cần chỉ định (các) đường dẫn đến dữ liệu trên đĩa và loại tập dữ liệu mà bạn đang tải con trăn CLI Bạn có thể nhập từ đĩa thông qua phương thức xuất xưởng Nếu dữ liệu của bạn được lưu trữ ở loại bạn đang nhập, thì bạn có thể tải dữ liệu đó bằng cách cung cấp các tham số 1 2 3 4 5 6 7 8 9 10 11 1254 và 1 2 3 4 5 6 7 8 9 10 11 1255 1 2 3 4 5 6 7 8 9 10 11 12 13 import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, ) Ngoài ra, khi nhập tập dữ liệu được gắn nhãn ở định dạng chẳng hạn như , bạn có thể thấy việc cung cấp các tham số 1 2 3 4 5 6 7 8 9 10 11 1256 và 1 2 3 4 5 6 7 8 9 10 11 1257 để chỉ định độc lập vị trí của phương tiện nguồn trên đĩa và tệp chú thích chứa nhãn cần nhập một cách tự nhiên hơn. 1 2 3 4 5 6 7 8 9 10 11 12 # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, ) Nhiều định dạng như cũng hỗ trợ lưu trữ đường dẫn tệp tuyệt đối đến phương tiện nguồn trực tiếp trong nhãn, trong trường hợp đó, bạn chỉ có thể cung cấp tham số 1 2 3 4 5 6 7 8 9 10 11 1257 1 2 3 4 5 6 7 8 # The path to a COCO labels JSON file containing absolute image paths labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, labels_path=labels_path, ) Nói chung, bạn có thể chuyển bất kỳ tham số nào cho định dạng mà bạn đang nhập vào. Ví dụ: hầu hết các trình nhập dựng sẵn đều hỗ trợ các tham số 1 2 3 4 5 6 7 8 9 10 11 1261, 1 2 3 4 5 6 7 8 9 10 11 1262 và 1 2 3 4 5 6 7 8 9 10 11 1263 tùy chọn, cung cấp hỗ trợ để nhập một tập hợp con nhỏ của tập dữ liệu lớn tiềm năng 1 2 3 4 5 6 7 # Import a random subset of 10 samples from the dataset dataset = fo.Dataset.from_dir( ..., max_samples=10, shuffle=True, seed=51, ) Bạn có thể nhập tập dữ liệu từ đĩa vào FiftyOne Nếu dữ liệu của bạn được lưu trữ ở loại bạn đang nhập, thì bạn có thể tải dữ liệu đó bằng cách cung cấp các tùy chọn 1 2 3 4 5 6 7 8 9 10 11 1264 và 1 2 3 4 5 6 7 8 9 10 11 1265 # A name for the dataset NAME=my-dataset # The directory containing the dataset to import DATASET_DIR=/path/to/dataset # The type of the dataset being imported # Any subclass of `fiftyone.types.Dataset` is supported TYPE=fiftyone.types.COCODetectionDataset # for example # Import the dataset fiftyone datasets create --name $NAME --dataset-dir $DATASET_DIR --type $TYPE Ngoài ra, khi nhập bộ dữ liệu được gắn nhãn ở các định dạng chẳng hạn như , bạn có thể thấy việc cung cấp các tham số 1 2 3 4 5 6 7 8 9 10 11 1256 và 1 2 3 4 5 6 7 8 9 10 11 1257 thông qua để chỉ định độc lập vị trí của phương tiện nguồn trên đĩa và tệp chú thích có chứa nhãn để nhập một cách tự nhiên hơn # The directory containing the source images DATA_PATH=/path/to/images # The path to the COCO labels JSON file LABELS_PATH=/path/to/coco-labels.json # Import the dataset fiftyone datasets create --name my-dataset \ --type fiftyone.types.COCODetectionDataset \ --kwargs \ data_path=$DATA_PATH \ labels_path=$LABELS_PATH Nhiều định dạng như cũng hỗ trợ lưu trữ đường dẫn tệp tuyệt đối đến phương tiện nguồn trực tiếp trong nhãn, trong trường hợp đó, bạn chỉ có thể cung cấp tham số 1 2 3 4 5 6 7 8 9 10 11 1257 import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )0 Nói chung, bạn có thể chuyển bất kỳ tham số nào cho định dạng bạn đang nhập thông qua. Ví dụ: hầu hết các trình nhập dựng sẵn đều hỗ trợ các tham số 1 2 3 4 5 6 7 8 9 10 11 1261, 1 2 3 4 5 6 7 8 9 10 11 1262 và 1 2 3 4 5 6 7 8 9 10 11 1263 tùy chọn, cung cấp hỗ trợ để nhập một tập hợp con nhỏ của tập dữ liệu lớn tiềm năng import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )1 định dạng được hỗ trợMỗi loại tập dữ liệu được hỗ trợ được đại diện bởi một lớp con của , được thư viện Python và CLI sử dụng để chỉ định dạng tập dữ liệu tương ứng khi đọc tập dữ liệu từ đĩa Loại tập dữ liệu Sự miêu tả Thư mục hình ảnh Danh mục video Tập dữ liệu được gắn nhãn bao gồm các hình ảnh và nhãn phân loại được liên kết của chúng ở định dạng JSON đơn giản Cây thư mục có các thư mục con xác định bộ dữ liệu phân loại hình ảnh Cây thư mục có các thư mục con xác định bộ dữ liệu phân loại video Tập dữ liệu được gắn nhãn bao gồm các hình ảnh và nhãn phân loại liên quan của chúng được lưu trữ dưới dạng TFRecords Tập dữ liệu được gắn nhãn bao gồm các hình ảnh và phát hiện đối tượng liên quan của chúng được lưu trữ ở định dạng JSON đơn giản Tập dữ liệu được gắn nhãn bao gồm video và các phát hiện tạm thời được liên kết của chúng ở định dạng JSON đơn giản Tập dữ liệu được gắn nhãn bao gồm các hình ảnh và phát hiện đối tượng liên quan của chúng được lưu trong Tập dữ liệu được gắn nhãn bao gồm các hình ảnh và phát hiện đối tượng liên quan của chúng được lưu ở định dạng VOC Tập dữ liệu được gắn nhãn bao gồm các hình ảnh và phát hiện đối tượng liên quan của chúng được lưu ở định dạng KITTI Tập dữ liệu được gắn nhãn bao gồm các hình ảnh và phát hiện đối tượng liên quan của chúng được lưu ở định dạng YOLOv4 Tập dữ liệu được gắn nhãn bao gồm các hình ảnh và phát hiện đối tượng liên quan của chúng được lưu ở định dạng YOLOv5 Tập dữ liệu được gắn nhãn bao gồm các hình ảnh và phát hiện đối tượng liên quan của chúng được lưu trữ dưới dạng TFRecords ở định dạng API phát hiện đối tượng TF Tập dữ liệu được gắn nhãn bao gồm các hình ảnh và các phân đoạn ngữ nghĩa liên quan của chúng được lưu trữ dưới dạng hình ảnh trên đĩa Tập dữ liệu được gắn nhãn bao gồm các hình ảnh và nhãn đa tác vụ được liên kết của chúng được lưu trữ ở định dạng hình ảnh CVAT Tập dữ liệu được gắn nhãn bao gồm các video và nhãn đa tác vụ được liên kết của chúng được lưu trữ ở định dạng video CVAT Tập dữ liệu được gắn nhãn bao gồm các hình ảnh và nhãn đa tác vụ được liên kết của chúng được lưu trữ ở định dạng OpenLABEL Tập dữ liệu được gắn nhãn bao gồm các video và nhãn đa tác vụ được liên kết của chúng được lưu trữ ở định dạng OpenLABEL Tập dữ liệu được gắn nhãn bao gồm các hình ảnh và các dự đoán đa nhiệm liên quan của chúng được lưu trữ ở định dạng ETA ImageLabels Tập dữ liệu được gắn nhãn bao gồm các hình ảnh và các dự đoán đa nhiệm liên quan của chúng được lưu ở định dạng Berkeley DeepDrive (BDD) Tập dữ liệu hình ảnh có dữ liệu hình ảnh và thuộc tính tùy chọn được lưu trữ ở định dạng DICOM Tập dữ liệu hình ảnh hoặc video có dữ liệu vị trí và nhãn được lưu trữ ở định dạng GeoJSON Tập dữ liệu hình ảnh có dữ liệu hình ảnh và vị trí địa lý được lưu trữ ở định dạng GeoTIFF Tập dữ liệu được gắn nhãn bao gồm các video và dự đoán đa nhiệm liên quan của chúng được lưu trữ ở định dạng ETA VideoLabels Tập dữ liệu bao gồm toàn bộ phương tiện truyền thông nguồn được xuất bản nhiều kỳ và liên kết với nó Nhập bộ dữ liệu ở định dạng tùy chỉnh bằng cách xác định lớp hoặc lớp của riêng bạn thư mục hình ảnhLoại đại diện cho một thư mục hình ảnh Các bộ dữ liệu thuộc loại này được đọc ở định dạng sau import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )2 nơi các tệp có loại MIME không phải hình ảnh bị bỏ qua Theo mặc định, tập dữ liệu có thể chứa các thư mục con hình ảnh lồng nhau, được liệt kê đệ quy Ghi chú Xem các tham số có thể được chuyển đến các phương thức như tùy chỉnh việc nhập bộ dữ liệu thuộc loại này Bạn có thể tạo tập dữ liệu FiftyOne từ thư mục hình ảnh như sau con trăn CLI import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )3 import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )4 import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )5 Để xem thư mục hình ảnh trong Ứng dụng FiftyOne mà không cần tạo bộ dữ liệu FiftyOne liên tục, bạn có thể thực thi import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )6 Thư mục videoLoại đại diện cho một thư mục video Các bộ dữ liệu thuộc loại này được đọc ở định dạng sau import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )2 nơi các tệp có loại MIME không phải video bị bỏ qua Theo mặc định, tập dữ liệu có thể chứa các thư mục con lồng nhau của video, được liệt kê đệ quy Ghi chú Xem các tham số có thể được chuyển đến các phương thức như tùy chỉnh việc nhập bộ dữ liệu thuộc loại này Bạn có thể tạo tập dữ liệu FiftyOne từ thư mục video như sau con trăn CLI import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )3 import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )9 1 2 3 4 5 6 7 8 9 10 11 120 Để xem thư mục video trong Ứng dụng FiftyOne mà không cần tạo bộ dữ liệu FiftyOne liên tục, bạn có thể thực thi 1 2 3 4 5 6 7 8 9 10 11 121 FiftyOneImageClassificationDatasetLoại đại diện cho một tập dữ liệu được gắn nhãn bao gồm các hình ảnh và (các) nhãn phân loại được liên kết của chúng được lưu trữ ở định dạng JSON đơn giản Các bộ dữ liệu thuộc loại này được đọc ở định dạng sau 1 2 3 4 5 6 7 8 9 10 11 122 Trong trường hợp đơn giản nhất, 1 2 3 4 5 6 7 8 9 10 11 1284 có thể là tệp JSON ở định dạng sau 1 2 3 4 5 6 7 8 9 10 11 123 Nếu trường 1 2 3 4 5 6 7 8 9 10 11 1285 được cung cấp, các giá trị 1 2 3 4 5 6 7 8 9 10 11 1286 là ID lớp được ánh xạ tới chuỗi nhãn lớp thông qua 1 2 3 4 5 6 7 8 9 10 11 1287. Nếu không có trường 1 2 3 4 5 6 7 8 9 10 11 1285 nào được cung cấp, thì các giá trị 1 2 3 4 5 6 7 8 9 10 11 1286 sẽ lưu trữ trực tiếp các chuỗi nhãn Giá trị mục tiêu trong 1 2 3 4 5 6 7 8 9 10 11 1290 cho hình ảnh không được gắn nhãn là 1 2 3 4 5 6 7 8 9 10 11 1291 (hoặc bị thiếu) Các UUID cũng có thể là các đường dẫn tương đối như 1 2 3 4 5 6 7 8 9 10 11 1292, trong trường hợp đó, các hình ảnh trong 1 2 3 4 5 6 7 8 9 10 11 1293 phải được sắp xếp trong các thư mục con lồng nhau có tên tương ứng hoặc chúng có thể là các đường dẫn tuyệt đối, trong trường hợp đó các hình ảnh có thể có hoặc không có trong 1 2 3 4 5 6 7 8 9 10 11 1293 Ngoài ra, 1 2 3 4 5 6 7 8 9 10 11 1284 có thể chứa các dự đoán với độ tin cậy được liên kết và các thuộc tính bổ sung ở định dạng sau 1 2 3 4 5 6 7 8 9 10 11 124 Bạn cũng có thể tải các phân loại nhiều nhãn ở định dạng này bằng cách lưu trữ danh sách các mục tiêu trong 1 2 3 4 5 6 7 8 9 10 11 1284 1 2 3 4 5 6 7 8 9 10 11 125 trong đó các giá trị đích trong 1 2 3 4 5 6 7 8 9 10 11 1290 có thể là chuỗi lớp, ID lớp hoặc ký hiệu ở định dạng được mô tả ở trên xác định nhãn lớp, thông tin mật và thuộc tính tùy chọn Ghi chú Xem các tham số có thể được chuyển đến các phương thức như tùy chỉnh việc nhập bộ dữ liệu thuộc loại này Bạn có thể tạo tập dữ liệu FiftyOne từ tập dữ liệu phân loại hình ảnh được lưu trữ ở định dạng trên như sau con trăn CLI import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )3 1 2 3 4 5 6 7 8 9 10 11 127 1 2 3 4 5 6 7 8 9 10 11 128 Để xem tập dữ liệu phân loại hình ảnh trong Ứng dụng FiftyOne mà không cần tạo tập dữ liệu FiftyOne liên tục, bạn có thể thực thi 1 2 3 4 5 6 7 8 9 10 11 129 Bạn cũng có thể chỉ định độc lập vị trí của các nhãn và thư mục gốc chứa các tệp phương tiện tương ứng bằng cách cung cấp các tham số 1 2 3 4 5 6 7 8 9 10 11 1257 và 1 2 3 4 5 6 7 8 9 10 11 1256 thay vì 1 2 3 4 5 6 7 8 9 10 11 1254 con trăn CLI 1 2 3 4 5 6 7 8 9 10 11 12 13 # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )1 # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )2 Ghi chú Nếu UUID trong nhãn của bạn là đường dẫn tuyệt đối đến phương tiện nguồn, thì bạn có thể bỏ qua tham số 1 2 3 4 5 6 7 8 9 10 11 1256 từ ví dụ trên ImageClassificationDirectoryTreeLoại đại diện cho một cây thư mục có các thư mục con xác định bộ dữ liệu phân loại hình ảnh Các bộ dữ liệu thuộc loại này được đọc ở định dạng sau # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )3 Hình ảnh chưa được gắn nhãn được lưu trữ trong thư mục con có tên # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )05 Mỗi thư mục lớp có thể chứa các thư mục con hình ảnh lồng nhau Ghi chú Xem các tham số có thể được chuyển đến các phương thức như tùy chỉnh việc nhập bộ dữ liệu thuộc loại này Bạn có thể tạo tập dữ liệu FiftyOne từ cây thư mục phân loại hình ảnh được lưu trữ ở định dạng trên như sau con trăn CLI import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )3 # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )5 # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )6 Để xem cây thư mục phân loại hình ảnh trong Ứng dụng FiftyOne mà không cần tạo tập dữ liệu FiftyOne liên tục, bạn có thể thực thi # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )7 VideoPhân loạiThư mụcCâyLoại đại diện cho một cây thư mục có các thư mục con xác định tập dữ liệu phân loại video Các bộ dữ liệu thuộc loại này được đọc ở định dạng sau # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )8 Các video chưa gắn nhãn được lưu trữ trong thư mục con có tên # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )05 Mỗi thư mục lớp có thể chứa các thư mục con lồng nhau của video Ghi chú Xem các tham số có thể được chuyển đến các phương thức như tùy chỉnh việc nhập bộ dữ liệu thuộc loại này Bạn có thể tạo tập dữ liệu FiftyOne từ cây thư mục phân loại video được lưu trữ ở định dạng trên như sau con trăn CLI import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )3 1 2 3 4 5 6 7 80 1 2 3 4 5 6 7 81 Để xem cây thư mục phân loại video trong Ứng dụng FiftyOne mà không cần tạo tập dữ liệu FiftyOne liên tục, bạn có thể thực thi 1 2 3 4 5 6 7 82 TFImageClassificationDatasetLoại đại diện cho tập dữ liệu được gắn nhãn bao gồm các hình ảnh và nhãn phân loại liên quan của chúng được lưu trữ dưới dạng TFRecords Các bộ dữ liệu thuộc loại này được đọc ở định dạng sau 1 2 3 4 5 6 7 83 trong đó các tính năng của TFRecords (có thể bị phân mảnh) được lưu trữ ở định dạng sau 1 2 3 4 5 6 7 84 Đối với các mẫu không được gắn nhãn, TFRecords không chứa các tính năng # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )13 Ghi chú Xem các tham số có thể được chuyển đến các phương thức như tùy chỉnh việc nhập bộ dữ liệu thuộc loại này Bạn có thể tạo tập dữ liệu FiftyOne từ tập dữ liệu phân loại hình ảnh được lưu trữ dưới dạng thư mục TFRecords ở định dạng trên như sau con trăn CLI 1 2 3 4 5 6 7 85 1 2 3 4 5 6 7 86 Khi lệnh trên được thực thi, hình ảnh trong TFRecords sẽ được ghi vào # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )16 được cung cấp, điều này là bắt buộc vì bộ dữ liệu FiftyOne phải cung cấp hình ảnh của chúng dưới dạng các tệp riêng lẻ trên đĩa 1 2 3 4 5 6 7 87 Khi lệnh trên được thực thi, hình ảnh trong TFRecords sẽ được ghi vào # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )17 được cung cấp, điều này là bắt buộc vì bộ dữ liệu FiftyOne phải cung cấp hình ảnh của chúng dưới dạng các tệp riêng lẻ trên đĩa Để xem tập dữ liệu phân loại hình ảnh được lưu trữ dưới dạng thư mục TFRecords trong Ứng dụng FiftyOne mà không tạo tập dữ liệu FiftyOne liên tục, bạn có thể thực thi 1 2 3 4 5 6 7 88 Ghi chú Bạn có thể cung cấp đối số # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )18 thay vì 1 2 3 4 5 6 7 8 9 10 11 1254 trong các ví dụ trên để chỉ định trực tiếp đường dẫn đến (các) TFRecord cần tải. Xem để biết chi tiết FiftyOneImageDetectionDatasetLoại đại diện cho một tập dữ liệu được gắn nhãn bao gồm các hình ảnh và các phát hiện đối tượng được liên kết của chúng được lưu trữ ở định dạng JSON đơn giản Các bộ dữ liệu thuộc loại này được đọc ở định dạng sau 1 2 3 4 5 6 7 8 9 10 11 122 trong đó 1 2 3 4 5 6 7 8 9 10 11 1284 là một tệp JSON ở định dạng sau # The path to a COCO labels JSON file containing absolute image paths labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, labels_path=labels_path, )0 và nơi tọa độ hộp giới hạn được thể hiện dưới dạng giá trị tương đối trong # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )23 Nếu trường 1 2 3 4 5 6 7 8 9 10 11 1285 được cung cấp, các giá trị 1 2 3 4 5 6 7 8 9 10 11 1286 là ID lớp được ánh xạ tới chuỗi nhãn lớp thông qua 1 2 3 4 5 6 7 8 9 10 11 1287. Nếu không có trường 1 2 3 4 5 6 7 8 9 10 11 1285 nào được cung cấp, thì các giá trị 1 2 3 4 5 6 7 8 9 10 11 1286 sẽ lưu trữ trực tiếp các chuỗi nhãn Giá trị mục tiêu trong 1 2 3 4 5 6 7 8 9 10 11 1290 cho hình ảnh không được gắn nhãn là 1 2 3 4 5 6 7 8 9 10 11 1291 (hoặc bị thiếu) Các UUID cũng có thể là các đường dẫn tương đối như 1 2 3 4 5 6 7 8 9 10 11 1292, trong trường hợp đó, các hình ảnh trong 1 2 3 4 5 6 7 8 9 10 11 1293 phải được sắp xếp trong các thư mục con lồng nhau có tên tương ứng hoặc chúng có thể là các đường dẫn tuyệt đối, trong trường hợp đó các hình ảnh có thể có hoặc không có trong 1 2 3 4 5 6 7 8 9 10 11 1293 Ghi chú Xem các tham số có thể được chuyển đến các phương thức như tùy chỉnh việc nhập bộ dữ liệu thuộc loại này Bạn có thể tạo tập dữ liệu FiftyOne từ tập dữ liệu phát hiện hình ảnh được lưu trữ ở định dạng trên như sau con trăn CLI import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )3 # The path to a COCO labels JSON file containing absolute image paths labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, labels_path=labels_path, )2 # The path to a COCO labels JSON file containing absolute image paths labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, labels_path=labels_path, )3 Để xem tập dữ liệu phát hiện hình ảnh được lưu trữ ở định dạng trên trong Ứng dụng FiftyOne mà không cần tạo tập dữ liệu FiftyOne liên tục, bạn có thể thực thi # The path to a COCO labels JSON file containing absolute image paths labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, labels_path=labels_path, )4 Bạn cũng có thể chỉ định độc lập vị trí của các nhãn và thư mục gốc chứa các tệp phương tiện tương ứng bằng cách cung cấp các tham số 1 2 3 4 5 6 7 8 9 10 11 1257 và 1 2 3 4 5 6 7 8 9 10 11 1256 thay vì 1 2 3 4 5 6 7 8 9 10 11 1254 con trăn CLI 1 2 3 4 5 6 7 8 9 10 11 12 13 # The path to a COCO labels JSON file containing absolute image paths labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, labels_path=labels_path, )6 # The path to a COCO labels JSON file containing absolute image paths labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, labels_path=labels_path, )7 Ghi chú Nếu UUID trong nhãn của bạn là đường dẫn tuyệt đối đến phương tiện nguồn, thì bạn có thể bỏ qua tham số 1 2 3 4 5 6 7 8 9 10 11 1256 từ ví dụ trên FiftyOneTemporalDetectionDatasetLoại đại diện cho một tập dữ liệu được gắn nhãn bao gồm các video và các phát hiện tạm thời được liên kết của chúng được lưu trữ ở định dạng JSON đơn giản Các bộ dữ liệu thuộc loại này được đọc ở định dạng sau 1 2 3 4 5 6 7 8 9 10 11 122 trong đó 1 2 3 4 5 6 7 8 9 10 11 1284 là một tệp JSON ở định dạng sau # The path to a COCO labels JSON file containing absolute image paths labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, labels_path=labels_path, )9 Phạm vi thời gian của từng lần phát hiện có thể được chỉ định thông qua khóa # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )42, khóa này sẽ chứa số khung # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )43 của lần phát hiện hoặc khóa # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )44, khóa này sẽ chứa dấu thời gian # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )45 của lần phát hiện tính bằng giây Nếu trường 1 2 3 4 5 6 7 8 9 10 11 1285 được cung cấp, các giá trị 1 2 3 4 5 6 7 8 9 10 11 1286 là ID lớp được ánh xạ tới chuỗi nhãn lớp thông qua 1 2 3 4 5 6 7 8 9 10 11 1287. Nếu không có trường 1 2 3 4 5 6 7 8 9 10 11 1285 nào được cung cấp, thì các giá trị 1 2 3 4 5 6 7 8 9 10 11 1286 sẽ lưu trữ trực tiếp các chuỗi nhãn Các video không được gắn nhãn có thể có khóa 1 2 3 4 5 6 7 8 9 10 11 1291 (hoặc bị thiếu) trong 1 2 3 4 5 6 7 8 9 10 11 1290 Các UUID cũng có thể là các đường dẫn tương đối như 1 2 3 4 5 6 7 8 9 10 11 1292, trong trường hợp đó, các hình ảnh trong 1 2 3 4 5 6 7 8 9 10 11 1293 phải được sắp xếp trong các thư mục con lồng nhau có tên tương ứng hoặc chúng có thể là các đường dẫn tuyệt đối, trong trường hợp đó các hình ảnh có thể có hoặc không có trong 1 2 3 4 5 6 7 8 9 10 11 1293 Ghi chú Xem các tham số có thể được chuyển đến các phương thức như tùy chỉnh việc nhập bộ dữ liệu thuộc loại này Bạn có thể tạo tập dữ liệu FiftyOne từ tập dữ liệu phát hiện tạm thời được lưu trữ ở định dạng trên như sau con trăn CLI import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )3 1 2 3 4 5 6 71 1 2 3 4 5 6 72 Để xem tập dữ liệu phát hiện tạm thời trong Ứng dụng FiftyOne mà không tạo tập dữ liệu FiftyOne liên tục, bạn có thể thực thi 1 2 3 4 5 6 73 Bạn cũng có thể chỉ định độc lập vị trí của các nhãn và thư mục gốc chứa các tệp phương tiện tương ứng bằng cách cung cấp các tham số 1 2 3 4 5 6 7 8 9 10 11 1257 và 1 2 3 4 5 6 7 8 9 10 11 1256 thay vì 1 2 3 4 5 6 7 8 9 10 11 1254 con trăn CLI 1 2 3 4 5 6 7 8 9 10 11 12 13 1 2 3 4 5 6 75 1 2 3 4 5 6 76 Ghi chú Nếu UUID trong nhãn của bạn là đường dẫn tuyệt đối đến phương tiện nguồn, thì bạn có thể bỏ qua tham số 1 2 3 4 5 6 7 8 9 10 11 1256 từ ví dụ trên Bộ dữ liệu phát hiện COCOLoại đại diện cho tập dữ liệu được gắn nhãn bao gồm các hình ảnh và phát hiện đối tượng được liên kết của chúng được lưu trong Các bộ dữ liệu thuộc loại này được đọc ở định dạng sau 1 2 3 4 5 6 77 trong đó 1 2 3 4 5 6 7 8 9 10 11 1284 là một tệp JSON ở định dạng sau 1 2 3 4 5 6 78 Xem thông số kỹ thuật đầy đủ của trường # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )64 Đối với tập dữ liệu chưa được gắn nhãn, 1 2 3 4 5 6 7 8 9 10 11 1284 không chứa trường # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )66 Thuộc tính # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )67 của tệp nhãn mã hóa vị trí của các hình ảnh tương ứng, có thể là bất kỳ vị trí nào sau đây
Ghi chú Xem các tham số có thể được chuyển đến các phương thức như tùy chỉnh việc nhập bộ dữ liệu thuộc loại này Bạn có thể tạo tập dữ liệu FiftyOne từ tập dữ liệu phát hiện COCO được lưu trữ ở định dạng trên như sau con trăn CLI import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )3 # Import a random subset of 10 samples from the dataset dataset = fo.Dataset.from_dir( ..., max_samples=10, shuffle=True, seed=51, )0 # Import a random subset of 10 samples from the dataset dataset = fo.Dataset.from_dir( ..., max_samples=10, shuffle=True, seed=51, )1 Để xem tập dữ liệu phát hiện COCO được lưu trữ ở định dạng trên trong Ứng dụng FiftyOne mà không cần tạo tập dữ liệu FiftyOne liên tục, bạn có thể thực thi # Import a random subset of 10 samples from the dataset dataset = fo.Dataset.from_dir( ..., max_samples=10, shuffle=True, seed=51, )2 Ghi chú Theo mặc định, tất cả các loại nhãn được hỗ trợ đều được tải (phát hiện, phân đoạn và điểm chính). Tuy nhiên, bạn có thể chọn (các) loại cụ thể để tải bằng cách chuyển đối số # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )74 tùy chọn cho các phương thức như # Import a random subset of 10 samples from the dataset dataset = fo.Dataset.from_dir( ..., max_samples=10, shuffle=True, seed=51, )3 Xem tài liệu đầy đủ về các tùy chọn nhập COCO có sẵn Bạn cũng có thể chỉ định độc lập vị trí của các nhãn và thư mục gốc chứa các tệp phương tiện tương ứng bằng cách cung cấp các tham số 1 2 3 4 5 6 7 8 9 10 11 1257 và 1 2 3 4 5 6 7 8 9 10 11 1256 thay vì 1 2 3 4 5 6 7 8 9 10 11 1254 con trăn CLI 1 2 3 4 5 6 7 8 9 10 11 12 13 # Import a random subset of 10 samples from the dataset dataset = fo.Dataset.from_dir( ..., max_samples=10, shuffle=True, seed=51, )5 # Import a random subset of 10 samples from the dataset dataset = fo.Dataset.from_dir( ..., max_samples=10, shuffle=True, seed=51, )6 Ghi chú Nếu khóa # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )67 của nhãn chứa đường dẫn tuyệt đối đến phương tiện nguồn, thì bạn có thể bỏ qua tham số 1 2 3 4 5 6 7 8 9 10 11 1256 từ ví dụ trên Nếu bạn có tập dữ liệu hiện có và dự đoán mô hình tương ứng được lưu trữ ở định dạng COCO, thì bạn có thể sử dụng để thêm nhãn vào tập dữ liệu một cách thuận tiện. Ví dụ bên dưới minh họa quá trình xuất khứ hồi rồi nhập lại cả dữ liệu hình ảnh và nhãn và chỉ nhãn ở định dạng COCO # Import a random subset of 10 samples from the dataset dataset = fo.Dataset.from_dir( ..., max_samples=10, shuffle=True, seed=51, )7 # Import a random subset of 10 samples from the dataset dataset = fo.Dataset.from_dir( ..., max_samples=10, shuffle=True, seed=51, )8 Ghi chú Xem mô tả đầy đủ về các cú pháp có sẵn để tải các dự đoán có định dạng COCO vào tập dữ liệu hiện có Bộ dữ liệu phát hiện VOCLoại đại diện cho tập dữ liệu được gắn nhãn bao gồm các hình ảnh và phát hiện đối tượng liên quan của chúng được lưu ở định dạng VOC Các bộ dữ liệu thuộc loại này được đọc ở định dạng sau # Import a random subset of 10 samples from the dataset dataset = fo.Dataset.from_dir( ..., max_samples=10, shuffle=True, seed=51, )9 trong đó các tệp XML nhãn có định dạng sau # A name for the dataset NAME=my-dataset # The directory containing the dataset to import DATASET_DIR=/path/to/dataset # The type of the dataset being imported # Any subclass of `fiftyone.types.Dataset` is supported TYPE=fiftyone.types.COCODetectionDataset # for example # Import the dataset fiftyone datasets create --name $NAME --dataset-dir $DATASET_DIR --type $TYPE0 trong đó trường # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )85 và/hoặc # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )86 của chú thích có thể được điền để chỉ định hình ảnh nguồn tương ứng Hình ảnh không được gắn nhãn không có tệp tương ứng trong # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )87 Các tệp 1 2 3 4 5 6 7 8 9 10 11 1293 và # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )87 có thể chứa các thư mục con lồng nhau của các hình ảnh và mặt nạ được sắp xếp song song Ghi chú Xem các tham số có thể được chuyển đến các phương thức như tùy chỉnh việc nhập bộ dữ liệu thuộc loại này Bạn có thể tạo tập dữ liệu FiftyOne từ tập dữ liệu phát hiện VOC được lưu trữ ở định dạng trên như sau con trăn CLI import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )3 # A name for the dataset NAME=my-dataset # The directory containing the dataset to import DATASET_DIR=/path/to/dataset # The type of the dataset being imported # Any subclass of `fiftyone.types.Dataset` is supported TYPE=fiftyone.types.COCODetectionDataset # for example # Import the dataset fiftyone datasets create --name $NAME --dataset-dir $DATASET_DIR --type $TYPE2 # A name for the dataset NAME=my-dataset # The directory containing the dataset to import DATASET_DIR=/path/to/dataset # The type of the dataset being imported # Any subclass of `fiftyone.types.Dataset` is supported TYPE=fiftyone.types.COCODetectionDataset # for example # Import the dataset fiftyone datasets create --name $NAME --dataset-dir $DATASET_DIR --type $TYPE3 Để xem tập dữ liệu phát hiện VOC được lưu trữ ở định dạng trên trong Ứng dụng FiftyOne mà không cần tạo tập dữ liệu FiftyOne liên tục, bạn có thể thực thi # A name for the dataset NAME=my-dataset # The directory containing the dataset to import DATASET_DIR=/path/to/dataset # The type of the dataset being imported # Any subclass of `fiftyone.types.Dataset` is supported TYPE=fiftyone.types.COCODetectionDataset # for example # Import the dataset fiftyone datasets create --name $NAME --dataset-dir $DATASET_DIR --type $TYPE4 Bạn cũng có thể chỉ định độc lập vị trí của các nhãn và thư mục gốc chứa các tệp phương tiện tương ứng bằng cách cung cấp các tham số 1 2 3 4 5 6 7 8 9 10 11 1257 và 1 2 3 4 5 6 7 8 9 10 11 1256 thay vì 1 2 3 4 5 6 7 8 9 10 11 1254 con trăn CLI 1 2 3 4 5 6 7 8 9 10 11 12 13 # A name for the dataset NAME=my-dataset # The directory containing the dataset to import DATASET_DIR=/path/to/dataset # The type of the dataset being imported # Any subclass of `fiftyone.types.Dataset` is supported TYPE=fiftyone.types.COCODetectionDataset # for example # Import the dataset fiftyone datasets create --name $NAME --dataset-dir $DATASET_DIR --type $TYPE6 # A name for the dataset NAME=my-dataset # The directory containing the dataset to import DATASET_DIR=/path/to/dataset # The type of the dataset being imported # Any subclass of `fiftyone.types.Dataset` is supported TYPE=fiftyone.types.COCODetectionDataset # for example # Import the dataset fiftyone datasets create --name $NAME --dataset-dir $DATASET_DIR --type $TYPE7 Ghi chú Nếu trường # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )86 của nhãn của bạn được điền bằng các đường dẫn tuyệt đối tới phương tiện nguồn, thì bạn có thể bỏ qua tham số 1 2 3 4 5 6 7 8 9 10 11 1256 từ ví dụ trên KITTIDetectionBộ dữ liệuLoại đại diện cho tập dữ liệu được gắn nhãn bao gồm các hình ảnh và phát hiện đối tượng liên quan của chúng được lưu ở định dạng KITTI Các bộ dữ liệu thuộc loại này được đọc ở định dạng sau # A name for the dataset NAME=my-dataset # The directory containing the dataset to import DATASET_DIR=/path/to/dataset # The type of the dataset being imported # Any subclass of `fiftyone.types.Dataset` is supported TYPE=fiftyone.types.COCODetectionDataset # for example # Import the dataset fiftyone datasets create --name $NAME --dataset-dir $DATASET_DIR --type $TYPE8 trong đó các tệp TXT nhãn là các tệp được phân tách bằng dấu cách trong đó mỗi hàng tương ứng với một đối tượng và cột 15 (và điểm thứ 16 tùy chọn) có các ý nghĩa sau # cột Tên Sự miêu tả Vỡ nợ 1 loại Nhãn đối tượng 1 cắt ngắn Một số float trong # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )98, trong đó 0 không bị cắt bớt và 1 bị cắt cụt hoàn toàn. Ở đây, cắt bớt đề cập đến đối tượng để lại ranh giới hình ảnh 0 1 bị tắc Một int trong # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )99 biểu thị trạng thái tắc, trong đó. - 0 = hiển thị đầy đủ- 1 = bị che một phần- 2 = bị che phần lớn- 3 = không xác định 0 1 chữ cái Góc quan sát của đối tượng, trong 1 2 3 4 5 6 7 800 0 4 bbox Hộp giới hạn 2D của đối tượng trong ảnh tính bằng pixel, ở định dạng 1 2 3 4 5 6 7 801 1 kích thước Kích thước đối tượng 3D, tính bằng mét, ở định dạng 1 2 3 4 5 6 7 802 0 1 vị trí Vị trí đối tượng 3D 1 2 3 4 5 6 7 803 trong tọa độ camera (tính bằng mét) 0 1 xoay_y Xoay quanh trục y trong tọa độ máy ảnh, trong 1 2 3 4 5 6 7 800 0 1 điểm 1 2 3 4 5 6 7 805 Độ tin cậy thả nổi để phát hiện Khi đọc bộ dữ liệu thuộc loại này, tất cả các cột sau bốn cột 1 2 3 4 5 6 7 806 là tùy chọn Hình ảnh không được gắn nhãn không có tệp tương ứng trong # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )87 Các tệp 1 2 3 4 5 6 7 8 9 10 11 1293 và # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )87 có thể chứa các thư mục con lồng nhau của các hình ảnh và mặt nạ được sắp xếp song song Ghi chú Xem các tham số có thể được chuyển đến các phương thức như tùy chỉnh việc nhập bộ dữ liệu thuộc loại này Bạn có thể tạo tập dữ liệu FiftyOne từ tập dữ liệu phát hiện KITTI được lưu trữ ở định dạng trên như sau con trăn CLI import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )3 # The directory containing the source images DATA_PATH=/path/to/images # The path to the COCO labels JSON file LABELS_PATH=/path/to/coco-labels.json # Import the dataset fiftyone datasets create --name my-dataset \ --type fiftyone.types.COCODetectionDataset \ --kwargs \ data_path=$DATA_PATH \ labels_path=$LABELS_PATH0 # The directory containing the source images DATA_PATH=/path/to/images # The path to the COCO labels JSON file LABELS_PATH=/path/to/coco-labels.json # Import the dataset fiftyone datasets create --name my-dataset \ --type fiftyone.types.COCODetectionDataset \ --kwargs \ data_path=$DATA_PATH \ labels_path=$LABELS_PATH1 Để xem tập dữ liệu phát hiện KITTI được lưu trữ ở định dạng trên trong Ứng dụng FiftyOne mà không tạo tập dữ liệu FiftyOne liên tục, bạn có thể thực thi # The directory containing the source images DATA_PATH=/path/to/images # The path to the COCO labels JSON file LABELS_PATH=/path/to/coco-labels.json # Import the dataset fiftyone datasets create --name my-dataset \ --type fiftyone.types.COCODetectionDataset \ --kwargs \ data_path=$DATA_PATH \ labels_path=$LABELS_PATH2 Bạn cũng có thể chỉ định độc lập vị trí của các nhãn và thư mục gốc chứa các tệp phương tiện tương ứng bằng cách cung cấp các tham số 1 2 3 4 5 6 7 8 9 10 11 1257 và 1 2 3 4 5 6 7 8 9 10 11 1256 thay vì 1 2 3 4 5 6 7 8 9 10 11 1254 con trăn CLI 1 2 3 4 5 6 7 8 9 10 11 12 13 # The directory containing the source images DATA_PATH=/path/to/images # The path to the COCO labels JSON file LABELS_PATH=/path/to/coco-labels.json # Import the dataset fiftyone datasets create --name my-dataset \ --type fiftyone.types.COCODetectionDataset \ --kwargs \ data_path=$DATA_PATH \ labels_path=$LABELS_PATH4 # The directory containing the source images DATA_PATH=/path/to/images # The path to the COCO labels JSON file LABELS_PATH=/path/to/coco-labels.json # Import the dataset fiftyone datasets create --name my-dataset \ --type fiftyone.types.COCODetectionDataset \ --kwargs \ data_path=$DATA_PATH \ labels_path=$LABELS_PATH5 Bộ dữ liệu YOLOv4Loại đại diện cho tập dữ liệu được gắn nhãn bao gồm các hình ảnh và phát hiện đối tượng liên quan của chúng được lưu ở định dạng YOLOv4 Các bộ dữ liệu thuộc loại này được đọc ở định dạng sau # The directory containing the source images DATA_PATH=/path/to/images # The path to the COCO labels JSON file LABELS_PATH=/path/to/coco-labels.json # Import the dataset fiftyone datasets create --name my-dataset \ --type fiftyone.types.COCODetectionDataset \ --kwargs \ data_path=$DATA_PATH \ labels_path=$LABELS_PATH6 trong đó 1 2 3 4 5 6 7 816 chứa nhãn lớp đối tượng # The directory containing the source images DATA_PATH=/path/to/images # The path to the COCO labels JSON file LABELS_PATH=/path/to/coco-labels.json # Import the dataset fiftyone datasets create --name my-dataset \ --type fiftyone.types.COCODetectionDataset \ --kwargs \ data_path=$DATA_PATH \ labels_path=$LABELS_PATH7 và 1 2 3 4 5 6 7 817 chứa danh sách các hình ảnh trong 1 2 3 4 5 6 7 8 9 10 11 1293 # The directory containing the source images DATA_PATH=/path/to/images # The path to the COCO labels JSON file LABELS_PATH=/path/to/coco-labels.json # Import the dataset fiftyone datasets create --name my-dataset \ --type fiftyone.types.COCODetectionDataset \ --kwargs \ data_path=$DATA_PATH \ labels_path=$LABELS_PATH8 Đường dẫn hình ảnh trong 1 2 3 4 5 6 7 817 có thể được chỉ định là đường dẫn tương đối (đến vị trí của tệp) hoặc là đường dẫn tuyệt đối. Ngoài ra, tệp này có thể được bỏ qua, trong trường hợp đó, thư mục 1 2 3 4 5 6 7 8 9 10 11 1293 được liệt kê để xác định các hình ảnh có sẵn Các tệp TXT trong 1 2 3 4 5 6 7 8 9 10 11 1293 là các tệp được phân tách bằng dấu cách trong đó mỗi hàng tương ứng với một đối tượng trong hình ảnh cùng tên, ở một trong các định dạng sau # The directory containing the source images DATA_PATH=/path/to/images # The path to the COCO labels JSON file LABELS_PATH=/path/to/coco-labels.json # Import the dataset fiftyone datasets create --name my-dataset \ --type fiftyone.types.COCODetectionDataset \ --kwargs \ data_path=$DATA_PATH \ labels_path=$LABELS_PATH9 trong đó 1 2 3 4 5 6 7 822 là chỉ số nguyên dựa trên số 0 của nhãn lớp đối tượng từ 1 2 3 4 5 6 7 816, tọa độ hộp giới hạn được biểu thị dưới dạng tọa độ tương đối trong # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )23 và 1 2 3 4 5 6 7 825 là độ tin cậy phát hiện tùy chọn trong # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )98 Hình ảnh không được gắn nhãn không có tệp TXT tương ứng trong 1 2 3 4 5 6 7 8 9 10 11 1293 Thư mục 1 2 3 4 5 6 7 8 9 10 11 1293 có thể chứa các thư mục con lồng nhau Ghi chú Xem các tham số có thể được chuyển đến các phương thức như tùy chỉnh việc nhập bộ dữ liệu thuộc loại này Bạn có thể tạo tập dữ liệu FiftyOne từ tập dữ liệu YOLOv4 được lưu trữ ở định dạng trên như sau con trăn CLI import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )3 import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )01 import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )02 Để xem tập dữ liệu YOLOv4 được lưu trữ ở định dạng trên trong Ứng dụng FiftyOne mà không cần tạo tập dữ liệu FiftyOne liên tục, bạn có thể thực thi import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )03 Bạn cũng có thể chỉ định độc lập vị trí của các nhãn và thư mục gốc chứa các tệp phương tiện tương ứng bằng cách cung cấp các tham số 1 2 3 4 5 6 7 8 9 10 11 1257 và 1 2 3 4 5 6 7 8 9 10 11 1256 thay vì 1 2 3 4 5 6 7 8 9 10 11 1254 con trăn CLI import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )04 import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )05 import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )06 Nếu bạn có tập dữ liệu hiện có và dự đoán mô hình tương ứng được lưu trữ ở định dạng YOLO, thì bạn có thể sử dụng để thêm nhãn vào tập dữ liệu một cách thuận tiện Ví dụ bên dưới minh họa quá trình xuất khứ hồi rồi nhập lại cả dữ liệu hình ảnh và nhãn và chỉ nhãn ở định dạng YOLO # Import a random subset of 10 samples from the dataset dataset = fo.Dataset.from_dir( ..., max_samples=10, shuffle=True, seed=51, )7 import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )08 Ghi chú Xem mô tả đầy đủ về các cú pháp có sẵn để tải các dự đoán có định dạng YOLO vào tập dữ liệu hiện có YOLOv5Bộ dữ liệuLoại đại diện cho tập dữ liệu được gắn nhãn bao gồm các hình ảnh và phát hiện đối tượng liên quan của chúng được lưu ở định dạng YOLOv5 Các bộ dữ liệu thuộc loại này được đọc ở định dạng sau import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )09 trong đó 1 2 3 4 5 6 7 837 chứa thông tin sau import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )10 Xem trang này để biết mô tả đầy đủ về định dạng có thể có của 1 2 3 4 5 6 7 837. Cụ thể, tập dữ liệu có thể chứa một hoặc nhiều phần tách với tên tùy ý, vì phần tách cụ thể được nhập hoặc xuất được chỉ định bởi đối số 1 2 3 4 5 6 7 839 để. Ngoài ra, 1 2 3 4 5 6 7 837 có thể được đặt bên ngoài 1 2 3 4 5 6 7 842 miễn là cung cấp tùy chọn 1 2 3 4 5 6 7 843 Ghi chú Bất kỳ đường dẫn tương đối nào trong tệp 1 2 3 4 5 6 7 837 hoặc mỗi tệp TXT được phân tách đều được diễn giải tương ứng với thư mục chứa các tệp này, không phải thư mục làm việc hiện tại của bạn Các tệp TXT trong # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )87 là các tệp được phân tách bằng dấu cách trong đó mỗi hàng tương ứng với một đối tượng trong hình ảnh cùng tên, ở một trong các định dạng sau # The directory containing the source images DATA_PATH=/path/to/images # The path to the COCO labels JSON file LABELS_PATH=/path/to/coco-labels.json # Import the dataset fiftyone datasets create --name my-dataset \ --type fiftyone.types.COCODetectionDataset \ --kwargs \ data_path=$DATA_PATH \ labels_path=$LABELS_PATH9 trong đó 1 2 3 4 5 6 7 822 là chỉ số nguyên dựa trên số 0 của nhãn lớp đối tượng từ 1 2 3 4 5 6 7 847, tọa độ hộp giới hạn được biểu thị dưới dạng tọa độ tương đối trong # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )23 và 1 2 3 4 5 6 7 825 là độ tin cậy phát hiện tùy chọn trong # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )98 Hình ảnh không được gắn nhãn không có tệp TXT tương ứng trong # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )87. Đường dẫn tệp nhãn cho mỗi hình ảnh có được bằng cách thay thế 1 2 3 4 5 6 7 852 bằng # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )87 trong đường dẫn hình ảnh tương ứng Các thư mục hình ảnh và nhãn cho một phần tách nhất định có thể chứa các thư mục con lồng nhau của các hình ảnh và nhãn được sắp xếp song song Ghi chú Xem các tham số có thể được chuyển đến các phương thức như tùy chỉnh việc nhập bộ dữ liệu thuộc loại này Bạn có thể tạo tập dữ liệu FiftyOne từ tập dữ liệu YOLOv5 được lưu trữ ở định dạng trên như sau import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )12 import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )13 Nếu bạn có tập dữ liệu hiện có và dự đoán mô hình tương ứng được lưu trữ ở định dạng YOLO, thì bạn có thể sử dụng để thêm nhãn vào tập dữ liệu một cách thuận tiện Ví dụ bên dưới minh họa quá trình xuất khứ hồi rồi nhập lại cả dữ liệu hình ảnh và nhãn và chỉ nhãn ở định dạng YOLO import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )14 import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )15 Ghi chú Xem mô tả đầy đủ về các cú pháp có sẵn để tải các dự đoán có định dạng YOLO vào tập dữ liệu hiện có TFObjectDetectionDatasetLoại đại diện cho tập dữ liệu được gắn nhãn bao gồm các hình ảnh và phát hiện đối tượng được liên kết của chúng được lưu trữ dưới dạng TFRecords ở định dạng API phát hiện đối tượng TF Các bộ dữ liệu thuộc loại này được đọc ở định dạng sau 1 2 3 4 5 6 7 83 trong đó các tính năng của TFRecords (có thể bị phân mảnh) được lưu trữ ở định dạng sau import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )17 TFRecords cho các mẫu không được gắn nhãn không chứa các tính năng 1 2 3 4 5 6 7 859 Ghi chú Xem các tham số có thể được chuyển đến các phương thức như tùy chỉnh việc nhập bộ dữ liệu thuộc loại này Bạn có thể tạo tập dữ liệu FiftyOne từ tập dữ liệu phát hiện đối tượng được lưu trữ dưới dạng thư mục TFRecords ở định dạng trên như sau con trăn CLI 1 2 3 4 5 6 7 85 import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )19 Khi lệnh trên được thực thi, hình ảnh trong TFRecords sẽ được ghi vào # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )16 được cung cấp, điều này là bắt buộc vì bộ dữ liệu FiftyOne phải cung cấp hình ảnh của chúng dưới dạng các tệp riêng lẻ trên đĩa import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )20 Khi lệnh trên được thực thi, hình ảnh trong TFRecords sẽ được ghi vào # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )17 được cung cấp, điều này là bắt buộc vì bộ dữ liệu FiftyOne phải cung cấp hình ảnh của chúng dưới dạng tệp riêng lẻ trên đĩa Để xem tập dữ liệu phát hiện đối tượng được lưu trữ dưới dạng thư mục TFRecords trong Ứng dụng FiftyOne mà không tạo tập dữ liệu FiftyOne liên tục, bạn có thể thực thi import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )21 Ghi chú Bạn có thể cung cấp đối số # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )18 thay vì 1 2 3 4 5 6 7 8 9 10 11 1254 trong các ví dụ trên để chỉ định trực tiếp đường dẫn đến (các) TFRecord cần tải. Xem để biết chi tiết ImageSegmentationDirectoryLoại đại diện cho một tập dữ liệu được gắn nhãn bao gồm các hình ảnh và các phân đoạn ngữ nghĩa liên quan của chúng được lưu trữ dưới dạng hình ảnh trên đĩa Các bộ dữ liệu thuộc loại này được đọc ở định dạng sau import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )22 trong đó # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )87 chứa các phân đoạn ngữ nghĩa được lưu trữ dưới dạng hình ảnh Hình ảnh không được gắn nhãn không có tệp tương ứng trong # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )87 Các tệp 1 2 3 4 5 6 7 8 9 10 11 1293 và # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )87 có thể chứa các thư mục con lồng nhau của các hình ảnh và mặt nạ được sắp xếp song song Ghi chú Xem các tham số có thể được chuyển đến các phương thức như tùy chỉnh việc nhập bộ dữ liệu thuộc loại này Bạn có thể tạo tập dữ liệu FiftyOne từ tập dữ liệu phân đoạn hình ảnh được lưu trữ ở định dạng trên như sau con trăn CLI import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )3 import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )24 import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )25 Để xem tập dữ liệu phân đoạn hình ảnh được lưu trữ ở định dạng trên trong Ứng dụng FiftyOne mà không cần tạo tập dữ liệu FiftyOne cố định, bạn có thể thực thi import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )26 Bạn cũng có thể chỉ định độc lập vị trí của các mặt nạ và thư mục gốc chứa các tệp phương tiện tương ứng bằng cách cung cấp các tham số 1 2 3 4 5 6 7 8 9 10 11 1257 và 1 2 3 4 5 6 7 8 9 10 11 1256 thay vì 1 2 3 4 5 6 7 8 9 10 11 1254 con trăn CLI 1 2 3 4 5 6 7 8 9 10 11 12 13 import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )28 import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )29 CVATImageBộ dữ liệuLoại đại diện cho tập dữ liệu được gắn nhãn bao gồm hình ảnh và các thẻ được liên kết của chúng và phát hiện đối tượng được lưu trữ ở định dạng hình ảnh CVAT Các bộ dữ liệu thuộc loại này được đọc ở định dạng sau import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )30 trong đó 1 2 3 4 5 6 7 878 là một tệp XML ở định dạng sau import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )31 Hình ảnh không được gắn nhãn không có thẻ 1 2 3 4 5 6 7 879 tương ứng trong 1 2 3 4 5 6 7 878 Trường 1 2 3 4 5 6 7 881 của thẻ 1 2 3 4 5 6 7 882 trong tệp nhãn mã hóa vị trí của hình ảnh tương ứng, có thể là bất kỳ hình ảnh nào sau đây
Ghi chú Xem các tham số có thể được chuyển đến các phương thức như tùy chỉnh việc nhập bộ dữ liệu thuộc loại này Bạn có thể tạo tập dữ liệu FiftyOne từ tập dữ liệu hình ảnh CVAT được lưu trữ ở định dạng trên như sau con trăn CLI import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )3 import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )33 import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )34 Để xem tập dữ liệu hình ảnh CVAT được lưu trữ ở định dạng trên trong Ứng dụng FiftyOne mà không tạo tập dữ liệu FiftyOne liên tục, bạn có thể thực thi import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )35 Bạn cũng có thể chỉ định độc lập vị trí của các nhãn và thư mục gốc chứa các tệp phương tiện tương ứng bằng cách cung cấp các tham số 1 2 3 4 5 6 7 8 9 10 11 1257 và 1 2 3 4 5 6 7 8 9 10 11 1256 thay vì 1 2 3 4 5 6 7 8 9 10 11 1254 con trăn CLI 1 2 3 4 5 6 7 8 9 10 11 12 13 import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )37 import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )38 Ghi chú Nếu khóa 1 2 3 4 5 6 7 881 của nhãn chứa đường dẫn tuyệt đối đến phương tiện nguồn, thì bạn có thể bỏ qua tham số 1 2 3 4 5 6 7 8 9 10 11 1256 từ ví dụ trên CVATVideoBộ dữ liệuLoại đại diện cho tập dữ liệu được gắn nhãn bao gồm các video và phát hiện đối tượng được liên kết của chúng được lưu trữ ở định dạng video CVAT Các bộ dữ liệu thuộc loại này được đọc ở định dạng sau # Import a random subset of 10 samples from the dataset dataset = fo.Dataset.from_dir( ..., max_samples=10, shuffle=True, seed=51, )9 nơi các tệp XML nhãn được lưu trữ ở định dạng sau import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )40 Video chưa gắn nhãn không có tệp tương ứng trong # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )87 Các tệp 1 2 3 4 5 6 7 8 9 10 11 1293 và # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )87 có thể chứa các thư mục con lồng nhau của các hình ảnh và nhãn được sắp xếp song song Ghi chú Xem các tham số có thể được chuyển đến các phương thức như tùy chỉnh việc nhập bộ dữ liệu thuộc loại này Bạn có thể tạo tập dữ liệu FiftyOne từ tập dữ liệu video CVAT được lưu trữ ở định dạng trên như sau con trăn CLI import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )3 import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )42 import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )43 Để xem tập dữ liệu video CVAT được lưu trữ ở định dạng trên trong Ứng dụng FiftyOne mà không tạo tập dữ liệu FiftyOne liên tục, bạn có thể thực thi import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )44 Bạn cũng có thể chỉ định độc lập vị trí của các nhãn và thư mục gốc chứa các tệp phương tiện tương ứng bằng cách cung cấp các tham số 1 2 3 4 5 6 7 8 9 10 11 1257 và 1 2 3 4 5 6 7 8 9 10 11 1256 thay vì 1 2 3 4 5 6 7 8 9 10 11 1254 con trăn CLI 1 2 3 4 5 6 7 8 9 10 11 12 13 import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )46 import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )47 OpenLABELImageDatasetLoại đại diện cho tập dữ liệu được gắn nhãn bao gồm các hình ảnh và các dự đoán đa tác vụ liên quan của chúng được lưu trữ = ở định dạng OpenLABEL OpenLABEL là một định dạng linh hoạt cho phép nhãn được lưu trữ theo nhiều cách khác nhau đối với các tệp phương tiện tương ứng. Phần sau đây liệt kê các cấu trúc có thể có trong đó dữ liệu phương tiện và tệp nhãn được định dạng OpenLABEL có thể được lưu trữ theo cách mà FiftyOne hiểu được
import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )48
1 2 3 4 5 6 7 8 9 10 11 122
import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )50 Đối với cấu trúc thực tế của chính các tệp nhãn, các nhãn được lưu trữ trong một hoặc nhiều tệp JSON và có thể theo nhiều định dạng khác nhau. Nói chung theo định dạng này Ghi chú Tất cả thông tin đối tượng được lưu trữ trong khóa # The path to a COCO labels JSON file containing absolute image paths labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, labels_path=labels_path, )05 được áp dụng cho hình ảnh tương ứng import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )51 Ghi chú Xem các tham số có thể được chuyển đến các phương thức như tùy chỉnh việc nhập bộ dữ liệu thuộc loại này Nếu việc tải liên quan đến một số đã cho, thì bạn có thể cung cấp đối số # The path to a COCO labels JSON file containing absolute image paths labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, labels_path=labels_path, )10 và # The path to a COCO labels JSON file containing absolute image paths labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, labels_path=labels_path, )11 để cho phép bạn khớp các điểm trong tệp chú thích của mình với các nhãn trong và tải các điểm cũng như thuộc tính của chúng theo đúng thứ tự Bạn có thể tạo tập dữ liệu FiftyOne từ tập dữ liệu hình ảnh OpenLABEL được lưu trữ ở định dạng trên như sau con trăn CLI import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )3 import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )53 import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )54 Để xem tập dữ liệu hình ảnh OpenLABEL được lưu trữ ở định dạng trên trong Ứng dụng FiftyOne mà không tạo tập dữ liệu FiftyOne cố định, bạn có thể thực thi import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )55 Bạn cũng có thể chỉ định độc lập vị trí của các nhãn và thư mục gốc chứa các tệp phương tiện tương ứng bằng cách cung cấp các tham số 1 2 3 4 5 6 7 8 9 10 11 1257 và 1 2 3 4 5 6 7 8 9 10 11 1256 thay vì 1 2 3 4 5 6 7 8 9 10 11 1254 con trăn CLI import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )04 import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )57 import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )58 Ghi chú OpenLABEL là một định dạng linh hoạt cho phép nhiều quyết định cụ thể của người dùng về cách thể hiện nhãn và siêu dữ liệu. Nếu bạn có dữ liệu tuân thủ OpenLABEL ở định dạng mà các nhà nhập khẩu hiện tại không hiểu, vui lòng đưa ra vấn đề hoặc đóng góp yêu cầu kéo OpenLABELVideoBộ dữ liệuLoại đại diện cho tập dữ liệu được gắn nhãn bao gồm các video và các dự đoán đa nhiệm liên quan của chúng được lưu trữ ở định dạng OpenLABEL OpenLABEL là một định dạng linh hoạt cho phép nhãn được lưu trữ theo nhiều cách khác nhau đối với các tệp phương tiện tương ứng. Phần sau đây liệt kê các cấu trúc có thể có trong đó dữ liệu phương tiện và tệp nhãn được định dạng OpenLABEL có thể được lưu trữ theo cách mà FiftyOne hiểu được
import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )48
1 2 3 4 5 6 7 8 9 10 11 122
import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )61 Đối với cấu trúc thực tế của chính các tệp nhãn, các nhãn được lưu trữ trong một hoặc nhiều tệp JSON và có thể theo nhiều định dạng khác nhau. Nói chung theo định dạng này import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )62 Ghi chú Xem các tham số có thể được chuyển đến các phương thức như tùy chỉnh việc nhập bộ dữ liệu thuộc loại này Nếu việc tải liên quan đến một số đã cho, thì bạn có thể cung cấp đối số # The path to a COCO labels JSON file containing absolute image paths labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, labels_path=labels_path, )10 và # The path to a COCO labels JSON file containing absolute image paths labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, labels_path=labels_path, )11 để cho phép bạn khớp các điểm trong tệp chú thích của mình với các nhãn trong và tải các điểm cũng như thuộc tính của chúng theo đúng thứ tự Bạn có thể tạo tập dữ liệu FiftyOne từ tập dữ liệu video OpenLABEL được lưu trữ ở định dạng trên như sau con trăn CLI import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )3 import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )64 import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )65 Để xem tập dữ liệu video OpenLABEL được lưu trữ ở định dạng trên trong Ứng dụng FiftyOne mà không cần tạo tập dữ liệu FiftyOne cố định, bạn có thể thực thi import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )66 Bạn cũng có thể chỉ định độc lập vị trí của các nhãn và thư mục gốc chứa các tệp phương tiện tương ứng bằng cách cung cấp các tham số 1 2 3 4 5 6 7 8 9 10 11 1257 và 1 2 3 4 5 6 7 8 9 10 11 1256 thay vì 1 2 3 4 5 6 7 8 9 10 11 1254 con trăn CLI import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )04 import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )68 import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )69 Ghi chú OpenLABEL là một định dạng linh hoạt cho phép nhiều quyết định cụ thể của người dùng về cách thể hiện nhãn và siêu dữ liệu. Nếu bạn có dữ liệu tuân thủ OpenLABEL ở định dạng mà các nhà nhập khẩu hiện tại không hiểu, vui lòng đưa ra vấn đề hoặc đóng góp yêu cầu kéo FiftyOneImageLabelsBộ dữ liệuLoại đại diện cho tập dữ liệu được gắn nhãn bao gồm các hình ảnh và các dự đoán đa nhiệm liên quan của chúng được lưu trữ ở định dạng ETA ImageLabels Các bộ dữ liệu thuộc loại này được đọc ở định dạng sau import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )70 trong đó # The path to a COCO labels JSON file containing absolute image paths labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, labels_path=labels_path, )31 là một tệp JSON ở định dạng sau import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )71 và nơi mỗi tệp JSON của nhãn được lưu trữ ở định dạng ETA ImageLabels Đối với những hình ảnh không được gắn nhãn, một tệp # The path to a COCO labels JSON file containing absolute image paths labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, labels_path=labels_path, )32 trống được lưu trữ Ghi chú Xem các tham số có thể được chuyển đến các phương thức như tùy chỉnh việc nhập bộ dữ liệu thuộc loại này Bạn có thể tạo tập dữ liệu FiftyOne từ tập dữ liệu nhãn hình ảnh được lưu trữ ở định dạng trên như sau con trăn CLI import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )3 import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )73 import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )74 Để xem tập dữ liệu nhãn hình ảnh được lưu trữ ở định dạng trên trong Ứng dụng FiftyOne mà không tạo tập dữ liệu FiftyOne cố định, bạn có thể thực thi import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )75 FiftyOneVideoLabelsBộ dữ liệuLoại đại diện cho tập dữ liệu được gắn nhãn bao gồm các video và nhãn được liên kết của chúng được lưu trữ ở định dạng ETA VideoLabels Các bộ dữ liệu thuộc loại này được đọc ở định dạng sau import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )70 trong đó # The path to a COCO labels JSON file containing absolute image paths labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, labels_path=labels_path, )31 là một tệp JSON ở định dạng sau import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )77 và nơi mỗi tệp JSON của nhãn được lưu trữ ở định dạng ETA VideoLabels Đối với các video chưa được gắn nhãn, một tệp # The path to a COCO labels JSON file containing absolute image paths labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, labels_path=labels_path, )37 trống được ghi Ghi chú Xem các tham số có thể được chuyển đến các phương thức như tùy chỉnh việc nhập bộ dữ liệu thuộc loại này Bạn có thể tạo tập dữ liệu FiftyOne từ tập dữ liệu nhãn video được lưu trữ ở định dạng trên như sau con trăn CLI import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )3 import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )79 import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )80 Để xem tập dữ liệu nhãn video được lưu trữ ở định dạng trên trong Ứng dụng FiftyOne mà không cần tạo tập dữ liệu FiftyOne liên tục, bạn có thể thực thi import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )81 BDDBộ dữ liệuLoại đại diện cho tập dữ liệu được gắn nhãn bao gồm các hình ảnh và các dự đoán đa nhiệm liên quan của chúng được lưu ở định dạng Berkeley DeepDrive (BDD) Các bộ dữ liệu thuộc loại này được đọc ở định dạng sau 1 2 3 4 5 6 77 trong đó 1 2 3 4 5 6 7 8 9 10 11 1284 là một tệp JSON ở định dạng sau import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )83 Hình ảnh không được gắn nhãn không có mục tương ứng trong 1 2 3 4 5 6 7 8 9 10 11 1284 Thuộc tính 1 2 3 4 5 6 7 881 của tệp nhãn mã hóa vị trí của các hình ảnh tương ứng, có thể là bất kỳ thuộc tính nào sau đây
Ghi chú Xem các tham số có thể được chuyển đến các phương thức như tùy chỉnh việc nhập bộ dữ liệu thuộc loại này Bạn có thể tạo tập dữ liệu FiftyOne từ tập dữ liệu BDD được lưu trữ ở định dạng trên như sau con trăn CLI import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )3 import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )85 import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )86 Để xem tập dữ liệu BDD được lưu trữ ở định dạng trên trong Ứng dụng FiftyOne mà không cần tạo tập dữ liệu FiftyOne liên tục, bạn có thể thực thi import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )87 Bạn cũng có thể chỉ định độc lập vị trí của các nhãn và thư mục gốc chứa các tệp phương tiện tương ứng bằng cách cung cấp các tham số 1 2 3 4 5 6 7 8 9 10 11 1257 và 1 2 3 4 5 6 7 8 9 10 11 1256 thay vì 1 2 3 4 5 6 7 8 9 10 11 1254 con trăn CLI 1 2 3 4 5 6 7 8 9 10 11 12 13 import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )89 import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )90 Ghi chú Nếu khóa 1 2 3 4 5 6 7 881 của nhãn chứa đường dẫn tuyệt đối đến phương tiện nguồn, thì bạn có thể bỏ qua tham số 1 2 3 4 5 6 7 8 9 10 11 1256 từ ví dụ trên Bộ dữ liệu DICOMLoại đại diện cho một tập dữ liệu bao gồm các hình ảnh và các thuộc tính liên quan của chúng được lưu trữ ở định dạng DICOM Ghi chú Bạn phải cài đặt pydicom để tải bộ dữ liệu DICOM Định dạng tiêu chuẩn cho các bộ dữ liệu thuộc loại này là như sau import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )91 trong đó mỗi tệp # The path to a COCO labels JSON file containing absolute image paths labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, labels_path=labels_path, )56 là một tệp DICOM có thể được đọc qua Ngoài ra, thay vì cung cấp 1 2 3 4 5 6 7 8 9 10 11 1254, bạn có thể cung cấp đối số # The path to a COCO labels JSON file containing absolute image paths labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, labels_path=labels_path, )59, đối số này có thể chỉ định trực tiếp mẫu hình cầu của các tệp DICOM hoặc đường dẫn đến tệp DICOMDIR Theo mặc định, tất cả các thuộc tính trong tệp DICOM có thể phát hiện được thông qua các loại được hỗ trợ đều được tải vào các trường cấp độ mẫu, nhưng bạn chỉ có thể chọn các thuộc tính cụ thể bằng cách chuyển đối số tùy chọn # The path to a COCO labels JSON file containing absolute image paths labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, labels_path=labels_path, )61 Ghi chú Khi nhập bộ dữ liệu DICOM, dữ liệu pixel được chuyển đổi thành hình ảnh 8 bit, sử dụng thuộc tính # The path to a COCO labels JSON file containing absolute image paths labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, labels_path=labels_path, )62 và # The path to a COCO labels JSON file containing absolute image paths labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, labels_path=labels_path, )63 (nếu có), để thông báo quá trình chuyển đổi Các hình ảnh được ghi vào một thư mục sao lưu mà bạn có thể định cấu hình bằng cách chuyển đối số # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )16. Theo mặc định, hình ảnh được ghi vào 1 2 3 4 5 6 7 8 9 10 11 1254 Hiện tại, chỉ hỗ trợ hình ảnh khung đơn, nhưng đóng góp của cộng đồng để hỗ trợ các loại hình ảnh 3D hoặc 4D (e. g. , CT scan) được hoan nghênh Ghi chú Xem các tham số có thể được chuyển đến các phương thức như tùy chỉnh việc nhập bộ dữ liệu thuộc loại này Bạn có thể tạo tập dữ liệu FiftyOne từ tập dữ liệu DICOM được lưu trữ ở định dạng chuẩn như sau con trăn CLI import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )3 import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )93 import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )94 Bạn có thể tạo tập dữ liệu FiftyOne từ mẫu toàn cầu của tệp DICOM hoặc đường dẫn đến tệp DICOMDIR như sau con trăn CLI import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )95 import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )96 import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )97 Bộ dữ liệu GeoJSONLoại đại diện cho tập dữ liệu bao gồm hình ảnh hoặc video và dữ liệu vị trí địa lý được liên kết của chúng và các thuộc tính tùy chọn được lưu trữ ở định dạng GeoJSON Các bộ dữ liệu thuộc loại này được đọc ở định dạng sau import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )98 trong đó 1 2 3 4 5 6 7 8 9 10 11 1284 là một tệp GeoJSON chứa một # The path to a COCO labels JSON file containing absolute image paths labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, labels_path=labels_path, )70 ở định dạng sau import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )99 trong đó trường # The path to a COCO labels JSON file containing absolute image paths labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, labels_path=labels_path, )71 có thể chứa bất kỳ đối tượng hình học GeoJSON hợp lệ nào và thuộc tính # The path to a COCO labels JSON file containing absolute image paths labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, labels_path=labels_path, )72 mã hóa tên của phương tiện tương ứng trong thư mục 1 2 3 4 5 6 7 8 9 10 11 1293. Thuộc tính # The path to a COCO labels JSON file containing absolute image paths labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, labels_path=labels_path, )72 cũng có thể là một đường dẫn tuyệt đối, có thể có hoặc không có trong thư mục 1 2 3 4 5 6 7 8 9 10 11 1293 Các mẫu không có dữ liệu vị trí sẽ có trường # The path to a COCO labels JSON file containing absolute image paths labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, labels_path=labels_path, )71 rỗng Trường # The path to a COCO labels JSON file containing absolute image paths labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, labels_path=labels_path, )77 của mỗi tính năng có thể chứa các nhãn bổ sung có thể được nhập Ghi chú Xem các tham số có thể được chuyển đến các phương thức như tùy chỉnh việc nhập bộ dữ liệu thuộc loại này Bạn có thể tạo tập dữ liệu FiftyOne từ tập dữ liệu GeoJSON được lưu trữ ở định dạng trên như sau con trăn CLI import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )3 1 2 3 4 5 6 7 8 9 10 11 1201 1 2 3 4 5 6 7 8 9 10 11 1202 Để xem tập dữ liệu GeoJSON được lưu trữ ở định dạng trên trong Ứng dụng FiftyOne mà không tạo tập dữ liệu FiftyOne liên tục, bạn có thể thực thi 1 2 3 4 5 6 7 8 9 10 11 1203 Bạn cũng có thể chỉ định độc lập vị trí của các nhãn và thư mục gốc chứa các tệp phương tiện tương ứng bằng cách cung cấp các tham số 1 2 3 4 5 6 7 8 9 10 11 1257 và 1 2 3 4 5 6 7 8 9 10 11 1256 thay vì 1 2 3 4 5 6 7 8 9 10 11 1254 con trăn CLI 1 2 3 4 5 6 7 8 9 10 11 12 13 1 2 3 4 5 6 7 8 9 10 11 1205 1 2 3 4 5 6 7 8 9 10 11 1206 Ghi chú Nếu khóa # The path to a COCO labels JSON file containing absolute image paths labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, labels_path=labels_path, )72 của nhãn chứa đường dẫn tuyệt đối đến phương tiện nguồn thì bạn có thể bỏ qua tham số 1 2 3 4 5 6 7 8 9 10 11 1256 từ ví dụ trên Bộ dữ liệu GeoTIFFLoại đại diện cho tập dữ liệu bao gồm hình ảnh và dữ liệu vị trí địa lý được liên kết của chúng được lưu trữ ở định dạng GeoTIFF Ghi chú Bạn phải cài đặt rasterio để tải bộ dữ liệu GeoTIFF Định dạng tiêu chuẩn cho các bộ dữ liệu thuộc loại này là như sau 1 2 3 4 5 6 7 8 9 10 11 1207 trong đó mỗi tệp # The path to a COCO labels JSON file containing absolute image paths labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, labels_path=labels_path, )86 là một hình ảnh GeoTIFF có thể được đọc qua Ngoài ra, thay vì cung cấp 1 2 3 4 5 6 7 8 9 10 11 1254, bạn có thể cung cấp đối số # The path to a COCO labels JSON file containing absolute image paths labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, labels_path=labels_path, )89, đối số này có thể chỉ định trực tiếp một danh sách hoặc mẫu toàn cầu của hình ảnh GeoTIFF để tải Tập dữ liệu sẽ chứa một trường có thuộc tính chứa tọa độ # The path to a COCO labels JSON file containing absolute image paths labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, labels_path=labels_path, )92 của mỗi tâm hình ảnh và thuộc tính chứa tọa độ # The path to a COCO labels JSON file containing absolute image paths labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, labels_path=labels_path, )92 của các góc của hình ảnh (theo chiều kim đồng hồ, bắt đầu từ góc trên cùng bên trái) Ghi chú Xem các tham số có thể được chuyển đến các phương thức như tùy chỉnh việc nhập bộ dữ liệu thuộc loại này Bạn có thể tạo tập dữ liệu FiftyOne từ tập dữ liệu GeoTIFF được lưu trữ ở định dạng chuẩn như sau con trăn CLI 1 2 3 4 5 6 7 8 9 10 11 1208 1 2 3 4 5 6 7 8 9 10 11 1209 1 2 3 4 5 6 7 8 9 10 11 1210 Bạn có thể tạo tập dữ liệu FiftyOne từ danh sách hoặc mẫu toàn cầu của hình ảnh GeoTIFF như sau con trăn CLI 1 2 3 4 5 6 7 85 1 2 3 4 5 6 7 8 9 10 11 1212 1 2 3 4 5 6 7 8 9 10 11 1213 Bộ dữ liệu FiftyOneCung cấp một đại diện đĩa của toàn bộ ở định dạng JSON được tuần tự hóa cùng với phương tiện nguồn của nó Các bộ dữ liệu thuộc loại này được đọc ở định dạng sau 1 2 3 4 5 6 7 8 9 10 11 1214 trong đó # The path to a COCO labels JSON file containing absolute image paths labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, labels_path=labels_path, )99 là tệp JSON chứa siêu dữ liệu được liên kết với tập dữ liệu, 1 2 3 4 5 6 700 là tệp JSON chứa bản trình bày được đánh số tự nhiên của các mẫu trong tập dữ liệu, 1 2 3 4 5 6 701 chứa bất kỳ số nào được đánh số tự động , 1 2 3 4 5 6 703 chứa bất kỳ số được đánh số tự động nào và Bộ dữ liệu video có tệp 1 2 3 4 5 6 707 bổ sung chứa biểu diễn tuần tự của các nhãn khung cho mỗi video trong bộ dữ liệu Ghi chú Xem các tham số có thể được chuyển đến các phương thức như tùy chỉnh việc nhập bộ dữ liệu thuộc loại này Bạn có thể tạo tập dữ liệu FiftyOne từ một thư mục ở định dạng trên như sau con trăn CLI import fiftyone as fo # The directory containing the dataset to import dataset_dir = "/path/to/dataset" # The type of the dataset being imported dataset_type = fo.types.COCODetectionDataset # for example # Import the dataset dataset = fo.Dataset.from_dir( dataset_dir=dataset_dir, dataset_type=dataset_type, )3 1 2 3 4 5 6 7 8 9 10 11 1216 1 2 3 4 5 6 7 8 9 10 11 1217 Để xem tập dữ liệu được lưu trữ trên đĩa trong Ứng dụng FiftyOne mà không cần tạo tập dữ liệu FiftyOne liên tục, bạn có thể thực thi 1 2 3 4 5 6 7 8 9 10 11 1218 Nếu bạn đã thực hiện việc sử dụng tham số 1 2 3 4 5 6 710 để loại bỏ tiền tố chung khỏi đường dẫn tệp phương tiện trong tập dữ liệu, thì chỉ cần thêm thông số 1 2 3 4 5 6 710 khi nhập lại vào FiftyOne để thêm tiền tố thích hợp vào trước mỗi đường dẫn phương tiện con trăn CLI 1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 5 6 7 8 9 10 11 1220 1 2 3 4 5 6 7 8 9 10 11 1221 Ghi chú Xuất bằng cách sử dụng tham số 1 2 3 4 5 6 712 và 1 2 3 4 5 6 710 là một cách thuận tiện để truyền tập dữ liệu giữa các môi trường làm việc, vì điều này cho phép bạn lưu trữ tệp phương tiện ở bất cứ đâu bạn muốn trong mỗi môi trường và sau đó chỉ cần cung cấp giá trị 1 2 3 4 5 6 710 thích hợp như minh họa ở trên khi nhập tập dữ liệu vào Định dạng tùy chỉnhNếu dữ liệu của bạn không tuân theo một trong các định dạng trước đó thì cách tiếp cận đơn giản và linh hoạt nhất để tải dữ liệu của bạn vào FiftyOne là thêm dữ liệu đó vào một Ngoài ra, lớp này cung cấp một phương thức xuất xưởng có thể được sử dụng để nhập tập dữ liệu bằng bất kỳ phiên bản nào Điều này có nghĩa là bạn có thể xác định lớp của riêng mình và sau đó nhập tập dữ liệu từ đĩa ở định dạng tùy chỉnh bằng cách sử dụng công thức sau 1 2 3 4 5 6 7 1 2 3 4 5 6 7 8 9 10 11 1223 Bạn cũng có thể xác định loại tùy chỉnh, cho phép bạn nhập bộ dữ liệu ở định dạng tùy chỉnh của mình bằng phương thức xuất xưởng 1 2 3 4 5 6 7 1 2 3 4 5 6 7 8 9 10 11 1225 Viết một DatasetImporter tùy chỉnhlà một giao diện trừu tượng; Bộ dữ liệu hình ảnh chưa được gắn nhãn Bộ dữ liệu hình ảnh được dán nhãn Bộ dữ liệu video chưa được gắn nhãn Bộ dữ liệu video được gắn nhãn tập dữ liệu được nhóm Để xác định trình nhập tùy chỉnh cho bộ dữ liệu hình ảnh chưa được gắn nhãn, hãy triển khai giao diện Mã giả bên dưới cung cấp một mẫu cho tùy chỉnh 1 2 3 4 5 6 7 8 9 10 11 1226 1 2 3 4 5 6 7 8 9 10 11 1227 Khi được gọi với tùy chỉnh, quá trình nhập được thực hiện hiệu quả thông qua mã giả bên dưới 1 2 3 4 5 6 7 8 9 10 11 1228 Lưu ý rằng trình nhập được gọi thông qua giao diện trình quản lý ngữ cảnh của nó, giao diện này sẽ tự động gọi các phương thức và của trình nhập để xử lý thiết lập/hoàn thành quá trình nhập Các hình ảnh trong tập dữ liệu được tải lặp lại bằng cách gọi phương thức của trình nhập Thuộc tính của trình nhập cho phép nó khai báo liệu có nên gọi phương thức của nó hay không sau khi tất cả các mẫu đã được nhập để truy xuất thông tin cấp tập dữ liệu để lưu trữ trên tập dữ liệu FiftyOne. Xem để biết thêm thông tin Thuộc tính của trình nhập cho phép nó khai báo xem nó có trả về các phiên bản cho mỗi hình ảnh mà nó tải khi được gọi hay không Để xác định trình nhập tùy chỉnh cho bộ dữ liệu hình ảnh được gắn nhãn, hãy triển khai giao diện Mã giả bên dưới cung cấp một mẫu cho tùy chỉnh 1 2 3 4 5 6 7 8 9 10 11 1229 1 2 3 4 5 6 7 8 9 10 11 1230 Khi được gọi với tùy chỉnh, quá trình nhập được thực hiện hiệu quả thông qua mã giả bên dưới 1 2 3 4 5 6 7 8 9 10 11 1231 Lưu ý rằng trình nhập được gọi thông qua giao diện trình quản lý ngữ cảnh của nó, giao diện này sẽ tự động gọi các phương thức và của trình nhập để xử lý thiết lập/hoàn thành quá trình nhập Hình ảnh và các phiên bản tương ứng của chúng trong tập dữ liệu được tải lặp lại bằng cách gọi phương thức của trình nhập Thuộc tính của trình nhập cho phép nó khai báo liệu có nên gọi phương thức của nó hay không sau khi tất cả các mẫu đã được nhập để truy xuất thông tin cấp tập dữ liệu để lưu trữ trên tập dữ liệu FiftyOne. Xem để biết thêm thông tin Thuộc tính của nhà nhập khẩu khai báo loại (các) nhãn mà nhà nhập khẩu sẽ sản xuất Thuộc tính của trình nhập cho phép nó khai báo xem nó có trả về các phiên bản cho mỗi hình ảnh mà nó tải khi được gọi hay không Để xác định trình nhập tùy chỉnh cho bộ dữ liệu video chưa được gắn nhãn, hãy triển khai giao diện Mã giả bên dưới cung cấp một mẫu cho tùy chỉnh 1 2 3 4 5 6 7 8 9 10 11 1226 1 2 3 4 5 6 7 8 9 10 11 1233 Khi được gọi với tùy chỉnh, quá trình nhập được thực hiện hiệu quả thông qua mã giả bên dưới 1 2 3 4 5 6 7 8 9 10 11 1234 Lưu ý rằng trình nhập được gọi thông qua giao diện trình quản lý ngữ cảnh của nó, giao diện này sẽ tự động gọi các phương thức và của trình nhập để xử lý thiết lập/hoàn thành quá trình nhập Các video trong bộ dữ liệu được tải lặp lại bằng cách gọi phương thức của trình nhập Thuộc tính của trình nhập cho phép nó khai báo liệu có nên gọi phương thức của nó hay không sau khi tất cả các mẫu đã được nhập để truy xuất thông tin cấp tập dữ liệu để lưu trữ trên tập dữ liệu FiftyOne. Xem để biết thêm thông tin Thuộc tính của trình nhập cho phép nó khai báo xem nó có trả về các phiên bản cho mỗi video mà nó tải khi được gọi hay không Để xác định trình nhập tùy chỉnh cho bộ dữ liệu video được gắn nhãn, hãy triển khai giao diện Mã giả bên dưới cung cấp một mẫu cho tùy chỉnh 1 2 3 4 5 6 7 8 9 10 11 1235 1 2 3 4 5 6 7 8 9 10 11 1236 Khi được gọi với tùy chỉnh, quá trình nhập được thực hiện hiệu quả thông qua mã giả bên dưới 1 2 3 4 5 6 7 8 9 10 11 1237 Lưu ý rằng trình nhập được gọi thông qua giao diện trình quản lý ngữ cảnh của nó, giao diện này sẽ tự động gọi các phương thức và của trình nhập để xử lý thiết lập/hoàn thành quá trình nhập Các video và nhãn tương ứng của chúng trong tập dữ liệu được tải lặp lại bằng cách gọi phương thức của trình nhập. Cụ thể, nhãn cấp độ mẫu cho video có thể được trả về trong giá trị # The directory containing the source images data_path = "/path/to/images" # The path to the COCO labels JSON file labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, data_path=data_path, labels_path=labels_path, )13 (có thể chứa một giá trị hoặc từ điển ánh xạ tên trường với nhãn) và nhãn cấp độ khung có thể được trả về trong từ điển # The path to a COCO labels JSON file containing absolute image paths labels_path = "/path/to/coco-labels.json" # Import the dataset dataset = fo.Dataset.from_dir( dataset_type=fo.types.COCODetectionDataset, labels_path=labels_path, )05 ánh xạ khung Thuộc tính của trình nhập cho phép nó khai báo liệu có nên gọi phương thức của nó hay không sau khi tất cả các mẫu đã được nhập để truy xuất thông tin cấp tập dữ liệu để lưu trữ trên tập dữ liệu FiftyOne. Xem để biết thêm thông tin Thuộc tính của nhà nhập khẩu khai báo loại (các) nhãn cấp mẫu mà nhà nhập khẩu sẽ sản xuất (nếu có), và thuộc tính của nhà nhập khẩu khai báo (các) nhãn cấp khung mà nhà nhập khẩu sẽ sản xuất (nếu Thuộc tính của trình nhập cho phép nó khai báo xem nó có trả về các phiên bản cho mỗi video mà nó tải khi được gọi hay không Để xác định trình nhập tùy chỉnh cho bộ dữ liệu được nhóm, hãy triển khai giao diện Mã giả bên dưới cung cấp một mẫu cho tùy chỉnh 1 2 3 4 5 6 7 8 9 10 11 1238 1 2 3 4 5 6 7 8 9 10 11 1239 Khi được gọi với tùy chỉnh, quá trình nhập được thực hiện hiệu quả thông qua mã giả bên dưới 1 2 3 4 5 6 7 8 9 10 11 1240 Lưu ý rằng trình nhập được gọi thông qua giao diện trình quản lý ngữ cảnh của nó, giao diện này sẽ tự động gọi các phương thức và của trình nhập để xử lý thiết lập/hoàn thành quá trình nhập Các nhóm trong tập dữ liệu được tải lặp lại bằng cách gọi phương thức của trình nhập Thuộc tính của trình nhập cho phép nó khai báo liệu có nên gọi phương thức của nó hay không sau khi tất cả các mẫu đã được nhập để truy xuất thông tin cấp tập dữ liệu để lưu trữ trên tập dữ liệu FiftyOne. Xem để biết thêm thông tin Thuộc tính của bộ nhập cho phép nó khai báo tên trường lưu thông tin cho từng mẫu Nhập thông tin cấp tập dữ liệuThuộc tính của trình nhập cho phép nó khai báo liệu phương thức của nó có nên được gọi hay không sau khi tất cả các mẫu đã được nhập để truy xuất một lệnh của thông tin cấp tập dữ liệu để lưu trữ trong thuộc tính của tập dữ liệu Trong trường hợp đặc biệt, nếu lệnh 1 2 3 4 5 6 791 chứa bất kỳ khóa nào được liệt kê bên dưới, các mục này sẽ được bật và lưu trữ trong trường tập dữ liệu chuyên dụng tương ứng
Viết một loại Tập dữ liệu tùy chỉnhFiftyOne cung cấp hệ thống loại để các định dạng tập dữ liệu có thể được tham chiếu thuận tiện theo loại của chúng khi đọc/ghi tập dữ liệu trên đĩa Chức năng chính của các lớp con là xác định cái nên được sử dụng để đọc các phiên bản của tập dữ liệu từ đĩa và cái nên được sử dụng để ghi các phiên bản của tập dữ liệu vào đĩa Xem để biết thêm thông tin về cách xác định các lớp tùy chỉnh Các loại tập dữ liệu tùy chỉnh có thể được khai báo bằng cách triển khai lớp con tương ứng với loại tập dữ liệu mà bạn đang làm việc với Bộ dữ liệu hình ảnh chưa được gắn nhãn Bộ dữ liệu hình ảnh được dán nhãn Bộ dữ liệu video chưa được gắn nhãn Bộ dữ liệu video được gắn nhãn tập dữ liệu được nhóm Mã giả dưới đây cung cấp một mẫu cho một lớp con tùy chỉnh 1 2 3 4 5 6 7 8 9 10 11 1241 1 2 3 4 5 6 7 8 9 10 11 1242 Lưu ý rằng, vì loại này đại diện cho một tập dữ liệu được nhóm, nên trình nhập của nó phải là một lớp con của và trình xuất của nó phải là một lớp con của |