Skip to content

multilabel classification upload with the CLI 😎#386

Merged
tonylampada merged 5 commits intomainfrom
tony/multilabel-upload
Jun 6, 2025
Merged

multilabel classification upload with the CLI 😎#386
tonylampada merged 5 commits intomainfrom
tony/multilabel-upload

Conversation

@tonylampada
Copy link
Copy Markdown
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 iurisilvio and lrosemberg 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
Copy Markdown
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
@iurisilvio iurisilvio deleted the tony/multilabel-upload branch August 27, 2025 12:40
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