Predict the scores for each class with given format specification using the specified model.
:param image: The input image to classify.
:type image: ImageTyping
:param model_name: The name of the model to use for prediction.
:type model_name: str
:param fmt: Format specification. Default is ``scores-top5``.
:return: Prediction result formatted with parameter ``fmt``.
:raises ValueError: If the model name is invalid.
:raises RuntimeError: If there's an error during prediction.
.. note::
The following specifications are supported in parameter ``fmt``:
- ``output``, raw prediction result, in np.ndarray format.
- ``logits``, (not available in some models) logits result, in np.ndarray format.
- ``embedding``, (not available in some models) embeddings result, in np.ndarray format.
- ``scores``, prediction scores of all classes in dict format.
- ``scores-topK``, prediction scores of top-K classes in dict format, e.g. ``scores-top10`` means top 10 scores.
- ``scores-<label_group>``, prediction scores of all classes with label group ``<label_group>``, e.g. ``scores-descriptions`` means all scores with ``descriptions`` label group.
- ``scores-topK-<label_group>``, prediction scores of top-K classes with label group ``<label_group>``.
Predict the scores for each class with given format specification using the specified model.
This function is a convenience wrapper around ClassifyModel's predict method.
:param image: The input image to classify.
:type image: ImageTyping
:param repo_id: The repository ID containing the models.
:type repo_id: str
:param model_name: The name of the model to use for prediction.
:type model_name: str
:param fmt: Format specification. Default is ``scores-top5``.
:param hf_token: Optional Hugging Face authentication token.
:type hf_token: Optional[str]
:return: Prediction result formatted with parameter ``fmt``.
:raises ValueError: If the model name is invalid.
:raises RuntimeError: If there's an error during prediction.
.. note::
The following specifications are supported in parameter ``fmt``:
- ``output``, raw prediction result, in np.ndarray format.
- ``logits``, (not available in some models) logits result, in np.ndarray format.
- ``embedding``, (not available in some models) embeddings result, in np.ndarray format.
- ``scores``, prediction scores of all classes in dict format.
- ``scores-topK``, prediction scores of top-K classes in dict format, e.g. ``scores-top10`` means top 10 scores.
- ``scores-<label_group>``, prediction scores of all classes with label group ``<label_group>``, e.g. ``scores-descriptions`` means all scores with ``descriptions`` label group.
- ``scores-topK-<label_group>``, prediction scores of top-K classes with label group ``<label_group>``.