Imageomics / pybioclip

Python package that simplifies using the BioCLIP foundation model.
MIT License
19 stars 3 forks source link

`bioclip --help` output update #58

Open egrace479 opened 2 weeks ago

egrace479 commented 2 weeks ago

The help output for the CLI has changed with the addition of alternate model options. Specifically:

bioclip predict -h produces:

usage: bioclip predict [-h] [--format {table,csv}] [--output OUTPUT]
                       [--rank {kingdom,phylum,class,order,family,genus,species} | --cls CLS | --bins BINS] [--k K] [--device DEVICE] [--model MODEL]
                       [--pretrained PRETRAINED]
                       image_file [image_file ...]

positional arguments:
  image_file            input image file(s)

options:
  -h, --help            show this help message and exit
  --format {table,csv}  format of the output, default: csv
  --output OUTPUT       print output to file, default: stdout
  --rank {kingdom,phylum,class,order,family,genus,species}
                        rank of the classification, default: species (when)
  --cls CLS             classes to predict: either a comma separated list or a path to a text file of classes (one per line), when specified the --rank
                        and --bins arguments are not allowed.
  --bins BINS           path to CSV file with two columns with the first being classes and second being bin names, when specified the --cls argument is
                        not allowed.
  --k K                 number of top predictions to show, default: 5
  --device DEVICE       device to use (cpu or cuda or mps), default: cpu
  --model MODEL         model identifier (see command list-models); default: hf-hub:imageomics/bioclip
  --pretrained PRETRAINED
                        pretrained model checkpoint as tag or file, depends on model; needed only if more than one is available (see command list-
                        models)

And bioclip embed -h returns

usage: bioclip embed [-h] [--output OUTPUT] [--device DEVICE] [--model MODEL] [--pretrained PRETRAINED] image_file [image_file ...]

positional arguments:
  image_file            input image file(s)

options:
  -h, --help            show this help message and exit
  --output OUTPUT       print output to file, default: stdout
  --device DEVICE       device to use (cpu or cuda or mps), default: cpu
  --model MODEL         model identifier (see command list-models); default: hf-hub:imageomics/bioclip
  --pretrained PRETRAINED
                        pretrained model checkpoint as tag or file, depends on model; needed only if more than one is available (see command list-
                        models)

We don't necessarily need to include the full options at the CLI section header, but I think it should be updated for predict and embed to match with image_file as a positional argument, and perhaps have a very simple note following it about the model options that links to the wiki.

I pulled up the help locally during the review and went back to the README curious about examples of those changes and realized the note on that is separated from the CLI help output which makes it look like it may be outdated and could potentially lead to confusion. Thoughts?

thompsonmj commented 1 day ago

I agree with the points above. Simple PR with updated menus and the wiki link for alternate models in #61.