https://github.com/chen0040/java-ssd-object-detection
Image SSD object detection in Java using Tensorrflow
https://github.com/chen0040/java-ssd-object-detection
non-maximum-suppression object-detection single-shot-multibox-detector ssd tensorflow yolo
Last synced: about 2 months ago
JSON representation
Image SSD object detection in Java using Tensorrflow
- Host: GitHub
- URL: https://github.com/chen0040/java-ssd-object-detection
- Owner: chen0040
- License: mit
- Created: 2018-03-31T13:42:47.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-15T13:47:34.000Z (over 7 years ago)
- Last Synced: 2025-07-13T05:18:47.671Z (3 months ago)
- Topics: non-maximum-suppression, object-detection, single-shot-multibox-detector, ssd, tensorflow, yolo
- Language: Java
- Size: 87.4 MB
- Stars: 26
- Watchers: 1
- Forks: 8
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# java-ssd-object-detection
Image SSD object detection in pure Java using Tensorrflow
This project is a derivation from the tensorflow [object detection](https://github.com/tensorflow/models/tree/master/samples/languages/java/object_detection)
codes but makes it easy to integrate with other java application# Install
To install, add the following dependency to your POM file:
```xml
com.github.chen0040
java-ssd-object-detection
1.0.1```
# Usage
The [sample codes](src/main/java/com/github/chen0040/objdetect/ObjectDetectorDemo.java) below shows how to detect
objects in an image using the [ObjectDetector](src/main/java/com/github/chen0040/objdetect/ObjectDetector.java)
class:```java
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 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:
