fuck you java
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
plugins {
|
plugins {
|
||||||
|
id("application")
|
||||||
id("java")
|
id("java")
|
||||||
|
kotlin("jvm") version "1.9.22"
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "org.jdetect"
|
group = "org.jdetect"
|
||||||
@@ -17,4 +19,16 @@ dependencies {
|
|||||||
|
|
||||||
tasks.test {
|
tasks.test {
|
||||||
useJUnitPlatform()
|
useJUnitPlatform()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
main {
|
||||||
|
resources {
|
||||||
|
srcDir("src/main/resources")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
application {
|
||||||
|
mainClass.set("org.jdetect.MainApp")
|
||||||
|
}
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ public class MainApp extends JFrame {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
System.out.println("it runs?");
|
||||||
try {
|
try {
|
||||||
SwingUtilities.invokeAndWait(() -> {
|
SwingUtilities.invokeAndWait(() -> {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -26,9 +26,14 @@ public class ModelLoader {
|
|||||||
InputStream weightsStream = ModelLoader.class.getResourceAsStream("/yolov4-tiny.weights");
|
InputStream weightsStream = ModelLoader.class.getResourceAsStream("/yolov4-tiny.weights");
|
||||||
InputStream configStream = ModelLoader.class.getResourceAsStream("/yolov4-tiny.cfg");
|
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();
|
byte[] weights = weightsStream.readAllBytes();
|
||||||
assert configStream != null;
|
assert configStream != null;
|
||||||
|
if (configStream == null) {
|
||||||
|
System.err.println("Could not find yolov4-tiny.cfg in classpath");
|
||||||
|
}
|
||||||
byte[] config = configStream.readAllBytes();
|
byte[] config = configStream.readAllBytes();
|
||||||
|
|
||||||
// Create temp files
|
// Create temp files
|
||||||
|
|||||||
Reference in New Issue
Block a user