SSD MultiBox Object Detector in Java

Java implementation of SSD MultiBox Object Detector

License

License

MIT
Categories

Categories

Java Languages
GroupId

GroupId

com.github.chen0040
ArtifactId

ArtifactId

java-ssd-object-detection
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

SSD MultiBox Object Detector in Java
Java implementation of SSD MultiBox Object Detector
Project URL

Project URL

https://github.com/chen0040/java-ssd-object-detection
Source Code Management

Source Code Management

https://github.com/chen0040/java-ssd-object-detection

Download java-ssd-object-detection

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.chen0040/java-ssd-object-detection/ -->
<dependency>
    <groupId>com.github.chen0040</groupId>
    <artifactId>java-ssd-object-detection</artifactId>
    <version>1.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.chen0040/java-ssd-object-detection/
implementation 'com.github.chen0040:java-ssd-object-detection:1.0.1'
// https://jarcasting.com/artifacts/com.github.chen0040/java-ssd-object-detection/
implementation ("com.github.chen0040:java-ssd-object-detection:1.0.1")
'com.github.chen0040:java-ssd-object-detection:jar:1.0.1'
<dependency org="com.github.chen0040" name="java-ssd-object-detection" rev="1.0.1">
  <artifact name="java-ssd-object-detection" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.chen0040', module='java-ssd-object-detection', version='1.0.1')
)
libraryDependencies += "com.github.chen0040" % "java-ssd-object-detection" % "1.0.1"
[com.github.chen0040/java-ssd-object-detection "1.0.1"]

Dependencies

compile (5)

Group / Artifact Type Version
org.tensorflow : tensorflow jar 1.5.0
org.tensorflow : proto jar 1.5.0
org.slf4j : slf4j-simple jar 1.7.21
org.slf4j : slf4j-api jar 1.7.21
net.lingala.zip4j : zip4j jar 1.3.2

provided (1)

Group / Artifact Type Version
org.projectlombok : lombok jar 1.16.10

Project Modules

There are no modules declared in this project.

java-ssd-object-detection

Image SSD object detection in pure Java using Tensorrflow

This project is a derivation from the tensorflow object detection codes but makes it easy to integrate with other java application

Install

To install, add the following dependency to your POM file:

<dependency>
  <groupId>com.github.chen0040</groupId>
  <artifactId>java-ssd-object-detection</artifactId>
  <version>1.0.1</version>
</dependency>

Usage

The sample codes below shows how to detect objects in an image using the ObjectDetector class:

import com.github.chen0040.objdetect.models.DetectedObj;

import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
import java.util.List;

public class ObjectDetectorDemo {
    public static void main(String[] args) throws Exception {
        ObjectDetector detector = new ObjectDetector();

        detector.loadModel();

        BufferedImage img = ImageIO.read(new File("images/test.jpg"));

        List<DetectedObj> result = detector.detectObjects(img);

        System.out.println("There are " + result.size() + " objects detected");
        for(int i=0; i < result.size(); ++i){
            System.out.println("# " + (i + 1) + ": " + result.get(i));
        }
        
        BufferedImage img2 = detector.drawDetectedObjects(img);
        ImageIO.write(img2, "PNG", new File("images/test_output.png"));
    }
}

Below shows the result of the test_output.png generated:

test_output.png

Versions

Version
1.0.1