Skip to content

Run this notebook online:Binder

Object detection with model zoo model

In this tutorial, you learn how to use a built-in model zoo model (SSD) to achieve an object detection task.

Preparation

This tutorial requires the installation of Java Kernel. To install Java Kernel, see the README.

// %mavenRepo snapshots https://oss.sonatype.org/content/repositories/snapshots/

%maven ai.djl:api:0.20.0
%maven ai.djl.mxnet:mxnet-engine:0.20.0
%maven ai.djl.mxnet:mxnet-model-zoo:0.20.0
%maven org.slf4j:slf4j-simple:1.7.32
import ai.djl.modality.cv.*;
import ai.djl.modality.cv.output.*;
import ai.djl.modality.cv.util.*;
import ai.djl.mxnet.zoo.*;
import ai.djl.repository.zoo.*;
import ai.djl.training.util.*;

Step 1: Load image

var img = ImageFactory.getInstance().fromUrl("https://resources.djl.ai/images/dog_bike_car.jpg");
img.getWrappedImage()