Use renamed segmentation model
This commit is contained in:
@@ -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")
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user