Skip to content

multilabel classification upload with the CLI 😎 #386

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

Merged
merged 5 commits into from
Jun 6, 2025

Conversation

tonylampada
Copy link
Collaborator

@tonylampada tonylampada commented Jun 6, 2025

Description

Adds support for uploading multilabel classification datasets via the CLI.

Type of change

  • New feature (non-breaking change which adds functionality)

How has this change been tested, please provide a testcase or example of how you tested the change?

  • Added unit tests for multilabel CSV parsing
  • Tested by uploading skinproblem-multilabel-classification from dev-env to staging

Will the change affect Universe? If so was this change tested in universe?

No

Any specific deployment considerations

  • will release 1.1.66

@tonylampada tonylampada marked this pull request as ready for review June 6, 2025 19:38
@tonylampada tonylampada self-assigned this Jun 6, 2025
@tonylampada tonylampada requested review from lrosemberg and iurisilvio and removed request for lrosemberg June 6, 2025 19:56
Comment on lines +198 to +203
rows = [r for r in parsed["rows"] if r["file_name"] == image["name"]]
if rows:
labels = rows[0]["labels"]
return {"type": "classification_multilabel", "labels": labels}
else:
return None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid iterating all data if you need only first item.

Suggested change
rows = [r for r in parsed["rows"] if r["file_name"] == image["name"]]
if rows:
labels = rows[0]["labels"]
return {"type": "classification_multilabel", "labels": labels}
else:
return None
rows = [r for r in parsed["rows"] if r["file_name"] == image["name"]]
row = next(r for r in parsed["rows"] if r["file_name"] == image["name"], None)
if row:
labels = row["labels"]
return {"type": "classification_multilabel", "labels": labels}
else:
return None

@tonylampada tonylampada merged commit 4e30788 into main Jun 6, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants