Skip to content

Commit

Permalink
fix: fix input size
Browse files Browse the repository at this point in the history
  • Loading branch information
jelychow committed Oct 28, 2024
1 parent def9345 commit 06c67ae
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class ImageEncoderCLIP(context: Context, private val preprocessor: PreprocessorC
}
}

fun splitFloatBuffer(buffer: FloatBuffer, parts: Int): List<FloatBuffer> {
private fun splitFloatBuffer(buffer: FloatBuffer, parts: Int): List<FloatBuffer> {
val totalSize = buffer.capacity()
val partSize = totalSize / parts
val result = mutableListOf<FloatBuffer>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ImageEncoderMobileCLIPv2(context: Context, private val preprocessor: Prepr

companion object {
private const val TAG = "ImageEncoderLiteRT"
private const val IMAGE_SIZE = 224
private const val IMAGE_SIZE = 256
private const val MODEL_PATH = "mobileclip-image.tflite"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class PreprocessorMobileCLIPv2 : Preprocessor {

companion object {
// FIXME 应为 256,但输入模型时出错,可能是模型转换有问题。
const val IMAGE_SIZE = 224
const val IMAGE_SIZE = 256
}

override suspend fun preprocessBatch(input: List<Bitmap>): List<TensorBuffer> {
Expand Down

0 comments on commit 06c67ae

Please sign in to comment.