forgot what i changed

This commit is contained in:
davpapp 2018-03-12 11:37:46 -04:00
parent 295251a4f0
commit 390b9e157d
6 changed files with 11 additions and 6 deletions

View File

@ -54,7 +54,7 @@ public class IronMiner {
int noIronOresDetected = 0;
int count = 0;
while (((System.currentTimeMillis() - startTime) / 1000.0 / 75) < 75) {
while (((System.currentTimeMillis() - startTime) / 1000.0 / 75) < 37) {
count++;
BufferedImage screenCapture = objectDetector.captureScreenshotGameWindow();
@ -98,7 +98,6 @@ public class IronMiner {
else {
oreLostCount = 0;
}
System.out.println("Tracking timespan: " + (System.currentTimeMillis() - trackingFrameStartTime));
}
}
@ -109,6 +108,7 @@ public class IronMiner {
System.out.println((System.currentTimeMillis() - startTime) / 1000);
}
}
System.out.println("Completed full mining session.");
}

View File

@ -56,7 +56,7 @@ public class ObjectDetector {
public ArrayList<DetectedObject> getObjectsInImage(BufferedImage image, double scoreThreshold) throws Exception {
List<Tensor<?>> outputs = null;
ArrayList<DetectedObject> detectedObjectsInImage = new ArrayList<DetectedObject>();
makeImageTensor(image);
try (Tensor<UInt8> input = makeImageTensor(image)) {
outputs =
model
@ -85,6 +85,9 @@ public class ObjectDetector {
}
}
}
for (Tensor<?> tensor : outputs) {
tensor = null;
}
return detectedObjectsInImage;
}
@ -123,7 +126,9 @@ public class ObjectDetector {
final long BATCH_SIZE = 1;
final long CHANNELS = 3;
long[] shape = new long[] {BATCH_SIZE, formattedImage.getHeight(), formattedImage.getWidth(), CHANNELS};
return Tensor.create(UInt8.class, shape, ByteBuffer.wrap(data));
ByteBuffer byteBuffer = ByteBuffer.wrap(data);
data = null;
return Tensor.create(UInt8.class, shape, byteBuffer);
}
private BufferedImage convertBufferedImage(BufferedImage sourceImage, int bufferedImageType) {

View File

@ -32,7 +32,7 @@ public class ObjectTracker {
public boolean update(BufferedImage image, Rect2d boundingBox) throws IOException {
boolean trackingSuccessful = objectTracker.update(BufferedImage2Mat(image), boundingBox);
System.out.print("Tracking: " + trackingSuccessful + ". Counter at ");
//System.out.print("Tracking: " + trackingSuccessful + ". Counter at ");
updateNumberOfFramesLostFor(trackingSuccessful);
return isObjectTrackingFailure();
}
@ -53,7 +53,7 @@ public class ObjectTracker {
}
private boolean isObjectTrackingFailure() {
System.out.println(numberOfFramesLostFor);
//System.out.println(numberOfFramesLostFor);
return numberOfFramesLostFor > 3;
}

Binary file not shown.

Binary file not shown.

Binary file not shown.