Coding the application

Let's jump into the code.

First we have the class, the VideoPlayer:

public class VideoPlayer {    private static final String AUTONOMOUS_DRIVING_RAMOK_TECH = "Autonomous Driving(";    private String windowName;    private volatile boolean stop = false;    private Yolo yolo;    private final OpenCVFrameConverter.ToMat converter = new OpenCVFrameConverter.ToMat();    public final static AtomicInteger atomicInteger = new AtomicInteger();    public void startRealTimeVideoDetection(String videoFileName, Speed selectedIndex, boolean yoloModel) throws java.lang.Exception {"Start detecting video " + videoFileName);        int id = atomicInteger.incrementAndGet();        windowName = AUTONOMOUS_DRIVING_RAMOK_TECH + id;; ...

Get Hands-On Java Deep Learning for Computer Vision now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.