change the resource path where AI models are stored
This commit is contained in:
parent
146db2c9c0
commit
bdd76877ef
4 changed files with 4 additions and 4 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -42,4 +42,4 @@ bin/
|
|||
.DS_Store
|
||||
|
||||
# Deep learning models
|
||||
src/main/resources/AIModels/prediction.onnx
|
||||
src/main/resources/dev/nuculabs/imagetagger/ai/*.onnx
|
|
@ -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:
|
||||
|
||||
|
|
|
@ -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())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue