fuck you java

This commit is contained in:
rattatwinko
2025-05-25 14:39:18 +02:00
parent 8c59e57711
commit 91b204f07e
3 changed files with 22 additions and 2 deletions

View File

@@ -1,5 +1,7 @@
plugins {
id("application")
id("java")
kotlin("jvm") version "1.9.22"
}
group = "org.jdetect"
@@ -18,3 +20,15 @@ dependencies {
tasks.test {
useJUnitPlatform()
}
sourceSets {
main {
resources {
srcDir("src/main/resources")
}
}
}
application {
mainClass.set("org.jdetect.MainApp")
}

View File

@@ -71,6 +71,7 @@ public class MainApp extends JFrame {
}
public static void main(String[] args) {
System.out.println("it runs?");
try {
SwingUtilities.invokeAndWait(() -> {
try {

View File

@@ -26,9 +26,14 @@ public class ModelLoader {
InputStream weightsStream = ModelLoader.class.getResourceAsStream("/yolov4-tiny.weights");
InputStream configStream = ModelLoader.class.getResourceAsStream("/yolov4-tiny.cfg");
assert weightsStream != null;
if (weightsStream == null) {
throw new IOException("Could not find yolov4-tiny.weights in classpath");
}
byte[] weights = weightsStream.readAllBytes();
assert configStream != null;
if (configStream == null) {
System.err.println("Could not find yolov4-tiny.cfg in classpath");
}
byte[] config = configStream.readAllBytes();
// Create temp files