diff --git a/build.gradle b/build.gradle index 3397852..1a5e240 100644 --- a/build.gradle +++ b/build.gradle @@ -46,6 +46,7 @@ dependencies { } implementation('org.kordamp.ikonli:ikonli-javafx:12.3.1') implementation('com.microsoft.onnxruntime:onnxruntime:1.17.1') + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1-Beta") testImplementation("org.junit.jupiter:junit-jupiter-api:${junitVersion}") testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${junitVersion}") } diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java index 3f98cd8..d4e085f 100644 --- a/src/main/java/module-info.java +++ b/src/main/java/module-info.java @@ -11,6 +11,7 @@ module com.nuculabs.dev.imagetagger.ui { requires com.microsoft.onnxruntime; requires java.logging; requires java.desktop; + requires kotlinx.coroutines.core; opens com.nuculabs.dev.imagetagger.ui to javafx.fxml, javafx.graphics; opens com.nuculabs.dev.imagetagger.ui.controls to javafx.fxml, javafx.graphics; diff --git a/src/main/kotlin/com/nuculabs/dev/imagetagger/ui/MainPageController.kt b/src/main/kotlin/com/nuculabs/dev/imagetagger/ui/MainPageController.kt index 14c14ee..28fbe1a 100644 --- a/src/main/kotlin/com/nuculabs/dev/imagetagger/ui/MainPageController.kt +++ b/src/main/kotlin/com/nuculabs/dev/imagetagger/ui/MainPageController.kt @@ -4,7 +4,6 @@ import com.nuculabs.dev.imagetagger.tag_prediction.ImageTagsPrediction import com.nuculabs.dev.imagetagger.ui.controls.ImageTagsEntryControl import javafx.application.Platform import javafx.fxml.FXML -import javafx.scene.control.Label import javafx.scene.control.ProgressBar import javafx.scene.control.Separator import javafx.scene.layout.VBox @@ -12,7 +11,6 @@ import javafx.stage.FileChooser import java.io.File import java.util.logging.Logger import javax.imageio.ImageIO -import kotlin.math.log class MainPageController { @@ -38,7 +36,7 @@ class MainPageController { progressBar.isVisible = true - progressBar.progress = 0.0; + progressBar.progress = 0.0 // Create a new thread to predict the images. val thread = Thread { val filePathsTotal = filePaths.count()