Add FiftyOne datamodule - #209
Conversation
mzweilin
left a comment
There was a problem hiding this comment.
Thanks for bringing the new feature. I was able to install, but I don't have an example to test with.
| # load FiftyOne dataset | ||
| if dataset_name in fo.list_datasets(): | ||
| self.dataset = fo.load_dataset(dataset_name) | ||
| elif dataset_name in foz.list_zoo_datasets(): |
There was a problem hiding this comment.
I don't think we want to load zoo datasets here, because it tries to index the dataset every time.
Maybe we should revert the changes, and use the FiftyOne command line to pre-load zoo datasets as datasets. For example, fiftyone zoo datasets load -s validation -n coco-2017-validation coco-2017 loads the validation split of coco-2017 as a dataset named "coco-2017-validation".
FiftyOne commands to load (index) datasets.Use COCO-2017 as an example. Unfortunately, FiftyOne does not support person-keypoints annotations yet. Download and load zoo datasetsfiftyone zoo datasets load \
coco-2017 \
-s train \
-n coco-2017-instances-train \
-k include_id=true label_types=detections,segmentations
fiftyone zoo datasets load \
coco-2017 \
-s validation \
-n coco-2017-instances-validation \
-k include_id=true label_types=detections,segmentationsLoad local datasetsfiftyone datasets create \
--name coco-2017-instances-validation \
--dataset-dir /raid/datasets/coco/ \
--type fiftyone.types.COCODetectionDataset \
--kwargs \
data_path="val2017" \
labels_path=/raid/datasets/coco/annotations/instances_val2017.json \
persistent=true \
include_id=trueUse the FiftyOne datamoduledatamodule:
train_dataset:
dataset_name: coco-2017-instances-train
gt_field: segmentations
val_dataset:
dataset_name: coco-2017-instances-validation
gt_field: segmentations |
Is this for the for the example documentation? |
6b718c8 to
e31e0cb
Compare
What does this PR do?
Add a new datamodule that loads FiftyOne datasets. This implementation let MART delegate the data handling to FiftyOne, where the user can do data curation tasks.
This data handling would be agnostic to MART, because at the end here is adapted a
torchvisiondataset.I set this implementation to be optional. The user can install the fiftyone dependencies by running:
Important:
Type of change
Please check all relevant options.
Testing
Please describe the tests that you ran to verify your changes. Consider listing any relevant details of your test configuration.
pytestCUDA_VISIBLE_DEVICES=0 python -m mart experiment=CIFAR10_CNN_Adv trainer=gpu trainer.precision=16reports 70% (21 sec/epoch).CUDA_VISIBLE_DEVICES=0,1 python -m mart experiment=CIFAR10_CNN_Adv trainer=ddp trainer.precision=16 trainer.devices=2 model.optimizer.lr=0.2 trainer.max_steps=2925 datamodule.ims_per_batch=256 datamodule.world_size=2reports 70% (14 sec/epoch).Before submitting
pre-commit run -acommand without errorsDid you have fun?
Make sure you had fun coding 🙃