voxel51 / fiftyone

Refine high-quality datasets and visual AI models
https://fiftyone.ai
Apache License 2.0
8.84k stars 557 forks source link

[FR] load annotations with specific status #4142

Open mmoollllee opened 8 months ago

mmoollllee commented 8 months ago

Proposal Summary

Adding an annotations job with segement_size to CVAT, makes me want to load those segments with e.g. CVAT Job Stage "validation" back into FiftyOne to validate the progress.

Motivation

What areas of FiftyOne does this feature affect?

Details

I'm adding annotation jobs to CVAT like this:

view.annotate(
    anno_key,
    label_field="bad_predictions",
    segment_size=50
)

and I'd like to have a filter_jobs key for load_annotations, e.g.:

dataset.load_annotations(
    anno_key, 
    dest_field="ground_truth", 
    unexpected="keep",
    filter_jobs="validation" # only import CVAT jobs with "stage: validation"
)

Willingness to contribute

The FiftyOne Community welcomes contributions! Would you or another member of your organization be willing to contribute an implementation of this feature?

brimoor commented 8 months ago

@mmoollllee this feature request makes sense to me 👍

In order to implement this, you'd need to update the download_annotations() interface to allow for the possibility of passing backend-specific **kwargs to customize how the annotations are downloaded.

Then, since the load_annotations() method is generic (supports multiple backends), you'd need to check its **kwargs and pull out any download parameters for the specific backend being used.

We have an extract_kwargs_for_function() utility that can do that 👍

Let me know if this makes sense and happy to provide additional guidance if I can be of assistance 🤗

mmoollllee commented 8 months ago

Happy to hear the feature makes sense :))

Puhh I digged around the provided code parts and need to accept that I'm totally lost in this advanced coding architecture... I guess this is beyond my abilities :( Maybe I'll give it another try and a lot of testing... Otherwise it seems like somebody else needs to implement this. Sorry :(

brimoor commented 8 months ago

I believe in you! If you're able to add your parameter only in this location, then we can help complete the feature for you 🤗

https://github.com/voxel51/fiftyone/blob/7853d085f398d9d2d47e356da822f65f725d98db/fiftyone/utils/cvat.py#L4562

mmoollllee commented 7 months ago

Thanks for your pushing me!! :)

See my current status in this commit

I have to say I'm not really confident in what I did. For example I never worked with videos in CVAT. Will this still work for videos?

I'd be happy to get feedback and another hint on how to pass job_status from dataset.load_annotations!