This is a torchvision version of
efficientnet_b1 model converted to the
OpenVINO™ IR (Intermediate Representation) format with weights compressed to FP16.
1import cv2
2from model_api.models import Model
3from model_api.visualizer import Visualizer
4
5# 1. Load model
6model = Model.from_pretrained("OpenVINO/efficientnet_b1-fp16-ov")
7
8# 2. Load image
9image = cv2.imread("image.jpg")
10
11# 3. Run inference
12result = model(image)
13
14# 4. Visualize and save results
15vis = Visualizer().render(image, result)
16cv2.imwrite("output.jpg", vis)
For more examples and possible optimizations, refer to the
Model API Documentation.
The original model is distributed under the
BSD-3-Clause license. More details can be found in
https://github.com/pytorch/vision.
Intel is committed to respecting human rights and avoiding causing or contributing to adverse impacts on human rights. See
Intel’s Global Human Rights Principles. Intel’s products and software are intended only to be used in applications that do not cause or contribute to adverse impacts on human rights.