Hello,
I am moving to this thread from a github issue since this topic isn’t germane to the reason it was opened, but is one that I am still working on. I have had some discussion with Craig, Keith and Karl there already about converting BufferedImage to Tensors.
I have a JavaFX app, which uses the AWT Robot class to take BufferedImage screenshots of a game, which I want to feed into a TF2 model to make predictions on. I then want to capture the bounding box information, send it back to the JavaFX portion of my app and draw them onto the image. The goal of this is to get it as close to real time as possible. I also want to use the bounding box information to feed coordinates of objects back to some other handler that will use the Robot class key presses to avoid them. Disclaimer: I am working on this for a Thesis project and not as a botter.
I was able to get the reading/writing to file example to work, but I believe instead of being able to send the bounding box coordinates back, it wrote a new image with bounding boxes on it to a file. I’m hesitant to go this route because it seems like it will be a lot of writing to disk.
I have also tried to add the preprocessing solution @karllessard has come up with and have attempted to use threading to speed it up but run into memory access errors. (context: I am inexperienced with concurrency).
Is there a solution, where I can use something like the DecodePng feature but instead of having it read from a file, just have it take in a Buffered Image? Or, is there a concurrent solution to doing it just within the JDK methodology?