EfficientNetB0
The EfficientNet originates from the "EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks" paper, which proposes a new compound scaling method that enables better performance on image classification tasks with fewer parameters. EfficientNet B0 is the smallest and most efficient model in the EfficientNet family, achieving state-of-the-art results on various image classification benchmarks with just 5.3 million parameters.
Overall
- Framework: PyTorch
- Model format: ONNX
- Model task: Image classification
- Source: github
Usages
Inputs
The input is a 3-channel image of 224x224 (height, width).
- Data Type:
numpy.float32
- Tensor Shape:
[1, 3, 224, 224]
- Memory Format: NCHW, where:
- N - batch size
- C - number of channels
- H - image height
- W - image width
- Color Order: BGR
- Optimal Batch Size (minimum: 1): <= 16
Outputs
The output is a numpy.float32
tensor with the shape ([1,]
), including
a class id. postprocess()
transforms the class id to a label string.
Pre/Postprocessing
furiosa.models.vision.EfficientNetB0
class provides preprocess
and postprocess
methods that
convert input images to input tensors and the model outputs to labels respectively.
You can find examples at EfficientNetB0 Usage.
furiosa.models.vision.EfficientNetB0.preprocess
Read and preprocess an image located at image_path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image |
Union[str, Path, npt.ArrayLike]
|
A path of an image. |
required |
Returns:
Type | Description |
---|---|
Tuple[np.ndarray, None]
|
The first element of the tuple is a numpy array that meets the input requirements of the model. The second element of the tuple is unused in this model and has no value. To learn more information about the output numpy array, please refer to Inputs. |
furiosa.models.vision.EfficientNetB0.postprocess
Convert the outputs of a model to a label string, such as car and cat.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_outputs |
Sequence[npt.ArrayLike]
|
the outputs of the model. Please learn more about the output of model, please refer to Outputs. |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
A classified label, e.g., "jigsaw puzzle". |
Notes on the source field of this model
There is a significant update in sdk version 0.9.0, which involves that the Furiosa's quantization tool adopts DFG(Data Flow Graph) as its output format instead of onnx. DFG is an IR of FuriosaAI that supports more diverse quantization schemes than onnx and is more specialized for FuriosaAI’s Warboy.
The EfficientNetB0 we offer has been quantized with furiosa-sdk 0.9.0 and thus formatted in DFG. The ONNX file in the source field is the original f32 model, not yet quantized.
In case you need to use a different batch size or start from scratch, you can either start from the DFG or use the original ONNX file (and repeat the quantization process).