Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] Allow patches exports to pull labels from Detection attributes/fields #1989

Closed
2 of 6 tasks
geoffrp opened this issue Aug 8, 2022 · 3 comments · Fixed by #1993
Closed
2 of 6 tasks

[FR] Allow patches exports to pull labels from Detection attributes/fields #1989

geoffrp opened this issue Aug 8, 2022 · 3 comments · Fixed by #1993
Labels
enhancement Code enhancement

Comments

@geoffrp
Copy link
Contributor

geoffrp commented Aug 8, 2022

Proposal Summary

After using FiftyOne and CVAT to organize my datasets, I've encountered a relatively common pattern of exporting patches into different classification datasets for secondary analysis. For instance, if my object detector was training on detecting apples, I may assign an attribute in CVAT to describe the color of a selected apple. To ease the requirements on my object detector, I would implement a second classifier to perform the attribute classification downstream. Right now, exporting patches seems to be limited to exporting images with labels assigned to Detections, not attributes stored in fields or the attributes dictionary of said label classes.

I think the export method should define an interface to make this type of exporting possible.

Motivation

  • What is the use case for this feature?

Users can now export image classification datasets from attributes rather than the original object detection labels, adding support for a two-step detect then classify pipeline.

  • Why is this use case valuable to support for FiftyOne users in general?

It seems to be a common pattern for designers who wish to constrain the complexity of their object detector's labeling schema and instead pass it along to a second stage classifier.

  • Why is this use case valuable to support for your project(s) or
    organization?

Several of my projects utilize this pattern and I don't see that changing too soon.

  • Why is it currently difficult to achieve this use case? (please be as
    specific as possible about why related FiftyOne features and components are
    insufficient)

Custom scripting isn't necessarily hard to write for this case, but allowing annotations to carry attributes meant for image classification applications seems to suggest this feature be in place.

What areas of FiftyOne does this feature affect?

  • App: FiftyOne application
  • Core: Core fiftyone Python library
  • Server: FiftyOne server

Details

It seems like the best options would be to add additional configuration to the ImagePatchesExtractor via the export method. Maybe something like label_schema for CVAT annotations that allows users to specify an attribute or multiple attributes to assign to each extracted patch?

There may be good reasons to also implement a custom transforms argument for ImagePatchesExtractor that would allow for greater control over the final look of extracted patches than the original alpha and force_square. This could be argued to be irrelevant as at training time users can apply whatever transforms they wish to properly format images to a model's input.

Willingness to contribute

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

  • Yes. I can contribute this feature independently.
  • Yes. I would be willing to contribute this feature with guidance from
    the FiftyOne community.
  • No. I cannot contribute this feature at this time.
@geoffrp geoffrp added the enhancement Code enhancement label Aug 8, 2022
@geoffrp geoffrp changed the title [FR] [FR] Allow patches exports to pull labels from Detection attributes/fields Aug 8, 2022
@geoffrp
Copy link
Contributor Author

geoffrp commented Aug 8, 2022

I'll add that I think both image classification and multi-label classification should be supported here.

@brimoor
Copy link
Contributor

brimoor commented Aug 11, 2022

Hey @geoffrp! LMK if #1993 covers this issue 😄

@geoffrp
Copy link
Contributor Author

geoffrp commented Aug 11, 2022

@brimoor Late to the approve here - yes, thank you! Much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Code enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants