|
@ -53,20 +53,20 @@ Create the operator via the following factory method |
|
|
|
|
|
|
|
|
**Parameters:** |
|
|
**Parameters:** |
|
|
|
|
|
|
|
|
  ***model_name***: *str* |
|
|
|
|
|
|
|
|
***model_name***: *str* |
|
|
|
|
|
|
|
|
  The model name in string. The default value is "resnet34". |
|
|
|
|
|
|
|
|
The model name in string. The default value is "resnet34". |
|
|
Refer [Timm Docs](https://fastai.github.io/timmdocs/#List-Models-with-Pretrained-Weights) to get a full list of supported models. |
|
|
Refer [Timm Docs](https://fastai.github.io/timmdocs/#List-Models-with-Pretrained-Weights) to get a full list of supported models. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
  ***num_classes***: *int* |
|
|
|
|
|
|
|
|
***num_classes***: *int* |
|
|
|
|
|
|
|
|
  The number of classes. The default value is 1000. |
|
|
|
|
|
|
|
|
The number of classes. The default value is 1000. |
|
|
It is related to model and dataset. |
|
|
It is related to model and dataset. |
|
|
|
|
|
|
|
|
  ***skip_preprocess***: *bool* |
|
|
|
|
|
|
|
|
***skip_preprocess***: *bool* |
|
|
|
|
|
|
|
|
  The flag to control whether to skip image preprocess. |
|
|
|
|
|
|
|
|
The flag to control whether to skip image preprocess. |
|
|
The default value is False. |
|
|
The default value is False. |
|
|
If set to True, it will skip image preprocessing steps (transforms). |
|
|
If set to True, it will skip image preprocessing steps (transforms). |
|
|
In this case, input image data must be prepared in advance in order to properly fit the model. |
|
|
In this case, input image data must be prepared in advance in order to properly fit the model. |
|
@ -81,17 +81,17 @@ It uses the pre-trained model specified by model name to generate an image embed |
|
|
|
|
|
|
|
|
**Parameters:** |
|
|
**Parameters:** |
|
|
|
|
|
|
|
|
  ***img***: *towhee.types.Image (a sub-class of numpy.ndarray)* |
|
|
|
|
|
|
|
|
***img***: *towhee.types.Image (a sub-class of numpy.ndarray)* |
|
|
|
|
|
|
|
|
  The decoded image data in numpy.ndarray. |
|
|
|
|
|
|
|
|
The decoded image data in numpy.ndarray. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
**Returns**: |
|
|
**Returns**: |
|
|
|
|
|
|
|
|
  *numpy.ndarray* |
|
|
|
|
|
|
|
|
*numpy.ndarray* |
|
|
|
|
|
|
|
|
  The image embedding extracted by model. |
|
|
|
|
|
|
|
|
The image embedding extracted by model. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|