diff --git a/.gitignore b/.gitignore index 39386a6..eb3460f 100644 --- a/.gitignore +++ b/.gitignore @@ -42,4 +42,4 @@ bin/ .DS_Store # Deep learning models -src/main/resources/AIModels/prediction.onnx \ No newline at end of file +src/main/resources/dev/nuculabs/imagetagger/ai/*.onnx \ No newline at end of file diff --git a/readme.md b/readme.md index ed03978..fdc4df7 100644 --- a/readme.md +++ b/readme.md @@ -28,7 +28,7 @@ The release archive is in the [releases page](https://github.com/dnutiu/ImageTag To build from source you will need Java 17 JDK and Gradle. Due to some GitHub limitations that do not allow me to upload large files, you'll need to download the AIModels -zip file which contains the deep learning models and place them into the `ImageTagger/src/main/resources/AIModels` path. +zip file which contains the deep learning models and place them into the `ImageTagger/src/main/resources/dev/nuculabs/imagetagger/ai` path. To build the project run: diff --git a/src/main/kotlin/dev/nuculabs/imagetagger/ai/ImageTagsPrediction.kt b/src/main/kotlin/dev/nuculabs/imagetagger/ai/ImageTagsPrediction.kt index 85b2107..1055340 100644 --- a/src/main/kotlin/dev/nuculabs/imagetagger/ai/ImageTagsPrediction.kt +++ b/src/main/kotlin/dev/nuculabs/imagetagger/ai/ImageTagsPrediction.kt @@ -21,13 +21,13 @@ class ImageTagsPrediction private constructor() { init { try { logger.info("Loaded ML model.") - ImageTagsPrediction::class.java.getResourceAsStream("/AIModels/prediction.onnx").let { modelFile -> + ImageTagsPrediction::class.java.getResourceAsStream("/dev/nuculabs/imagetagger/ai/prediction.onnx").let { modelFile -> ortSession = ortEnv.createSession( modelFile!!.readBytes(), OrtSession.SessionOptions() ) } - ImageTagsPrediction::class.java.getResourceAsStream("/AIModels/prediction_categories.txt") + ImageTagsPrediction::class.java.getResourceAsStream("/dev/nuculabs/imagetagger/ai/prediction_categories.txt") .let { classesFile -> modelClasses.addAll(0, classesFile!!.bufferedReader().readLines()) } diff --git a/src/main/resources/AIModels/prediction_categories.txt b/src/main/resources/dev/nuculabs/imagetagger/ai/prediction_categories.txt similarity index 100% rename from src/main/resources/AIModels/prediction_categories.txt rename to src/main/resources/dev/nuculabs/imagetagger/ai/prediction_categories.txt