Use renamed segmentation model

This commit is contained in:
Pierre-Yves Nicolas
2025-09-13 07:12:51 +02:00
parent de7cc0407d
commit 60fb714356
2 changed files with 4 additions and 4 deletions

View File

@@ -1,9 +1,9 @@
import org.gradle.api.tasks.Copy import org.gradle.api.tasks.Copy
import java.net.URL import java.net.URL
val modelVersion = "v0.6.1" val modelVersion = "v1.0.0"
val modelFileName = "document-segmentation-model.tflite" val modelFileName = "fairscan-segmentation-model.tflite"
val modelUrl = "https://github.com/pynicolas/document-segmentation-model/releases/download/$modelVersion/$modelFileName" val modelUrl = "https://github.com/pynicolas/fairscan-segmentation-model/releases/download/$modelVersion/$modelFileName"
val downloadedModelPath = layout.buildDirectory.file("downloads/$modelFileName") val downloadedModelPath = layout.buildDirectory.file("downloads/$modelFileName")
val generatedAssetsDir = layout.buildDirectory.dir("generated/assets") val generatedAssetsDir = layout.buildDirectory.dir("generated/assets")

View File

@@ -53,7 +53,7 @@ class ImageSegmentationService(private val context: Context) {
fun initialize() { fun initialize() {
interpreter = try { interpreter = try {
val litertBuffer = FileUtil.loadMappedFile(context, "document-segmentation-model.tflite") val litertBuffer = FileUtil.loadMappedFile(context, "fairscan-segmentation-model.tflite")
Log.i(TAG, "Loaded LiteRT model") Log.i(TAG, "Loaded LiteRT model")
val options = Interpreter.Options().apply { val options = Interpreter.Options().apply {
numThreads = 2 numThreads = 2