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

[FEATURE REQUEST] CLI support for image-classification #608

Open
billytcl opened this issue Apr 30, 2024 · 5 comments
Open

[FEATURE REQUEST] CLI support for image-classification #608

billytcl opened this issue Apr 30, 2024 · 5 comments

Comments

@billytcl
Copy link

Feature Request

I'm trying to use the CLI for image classification on autotrain-advanced local but I'm running into the error:

Exception: Image classification is not yet supported for local datasets using the CLI. Please use UI.

What is the roadmap for this feature to be enabled?

Motivation

We have large numbers of batches that we'd like to automate the autotrain process (running locally) and try different model architectures. Using a UI would be really cumbersome.

Additional Context

No response

@abhishekkrthakur
Copy link
Member

it just means that local dataset support is not there. you can still upload your dataset to huggingface hub and use it for training using the cli. is that possible for you?

@billytcl
Copy link
Author

billytcl commented May 1, 2024 via email

@abhishekkrthakur
Copy link
Member

i didnt ask you to use UI.
Lemme rephrase: are your image datasets on huggingface hub? if yes, you can use them directly in the CLI

@billytcl
Copy link
Author

billytcl commented May 1, 2024 via email

@abhishekkrthakur
Copy link
Member

CLI now supports image classification.
Example config:

task: image_classification
base_model: google/vit-base-patch16-224
project_name: autotrain-local-flowers-finetuned
log: tensorboard
backend: local

data:
  # path contains the training and validation folders
  path: Datasets/image_classification/flowers
  train_split: train # this is the training folder, containing subfolders with classnames and images inside the subfolders
  valid_split: null # if you have a validation folder, use its name here
  column_mapping: # dont touch for local datasets
    image_column: image
    target_column: labels

params:
  epochs: 2
  batch_size: 4
  lr: 2e-5
  optimizer: adamw_torch
  scheduler: linear
  gradient_accumulation: 1
  mixed_precision: fp16

hub:
  username: ${HF_USERNAME}
  token: ${HF_TOKEN}
  push_to_hub: true

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

No branches or pull requests

2 participants