object MllamaUtils
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- MllamaUtils
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
arrayToBufferedImage(imageArray: Array[Array[Array[Int]]]): BufferedImage
Convert a 3D array to a BufferedImage
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
buildAspectRatioMask(aspectRatios: List[List[(Int, Int)]], maxImageTiles: Int): Array[Array[Array[Int]]]
build aspect ratio mask
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
convertAspectRatiosToIds(aspectRatios: List[List[(Int, Int)]], maxImageTiles: Int): Array[Array[Int]]
Convert aspect ratios to IDs
- def convertSparseCrossAttentionMaskToDense(crossAttentionTokenMask: Array[Array[Array[Int]]], numTiles: Array[Array[Int]], maxNumTiles: Int, length: Int): Array[Array[Array[Array[Int]]]]
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
floatArrayToBufferedImage(imageArray: Array[Array[Array[Float]]], rescaleFactor: Double): BufferedImage
Convert a 3D array of floats to a BufferedImage
-
def
getAllSupportedAspectRatios(maxImageTiles: Int): List[(Int, Int)]
Get all supported aspect ratios for a given max number of image tiles
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getCrossAttentionTokenMask(inputIds: Array[Int], imageTokenId: Int): Array[Array[Int]]
-
def
getImageSizeFitToCanvas(imageHeight: Int, imageWidth: Int, canvasHeight: Int, canvasWidth: Int, tileSize: Int): (Int, Int)
Get the size of the image that fits the canvas
-
def
getOptimalTiledCanvas(imageHeight: Int, imageWidth: Int, maxImageTiles: Int, tileSize: Int): (Int, Int)
Get the optimal tiled canvas size for the image
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
imageCropToArray(imgCrop: BufferedImage): Array[Array[Array[Int]]]
Convert a crop of an image to a 3D array
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
packAspectRatios(aspectRatios: List[List[(Int, Int)]], padValue: Int = 1): Array[Array[Array[Int]]]
Pack aspect ratios into a 3D array
-
def
packImages(batchImages: List[Array[Array[Array[Array[Array[Float]]]]]], maxImageTiles: Int): (Array[Array[Array[Array[Array[Array[Float]]]]]], List[List[Int]])
Pack images into a 6D array
- def pad(image: BufferedImage, paddingConstant: Int, aspectRatio: (Int, Int), tileHeight: Int, tileWidth: Int): BufferedImage
- def padBufferedImage(image: BufferedImage, totalPadding: (Int, Int), constantColor: Int): BufferedImage
- def padConstant(image: Array[Array[Float]], padding: Int, constantValue: Float): Array[Array[Float]]
-
def
resizeImage(width: Int, height: Int, resample: Int, maxImageTiles: Int)(image: BufferedImage): (BufferedImage, (Int, Int))
Resize an image to fit the canvas
-
def
splitToTiles(image: BufferedImage, numTilesHeight: Int, numTilesWidth: Int, mean: Array[Double], std: Array[Double], doNormalize: Boolean, doRescale: Boolean, rescaleFactor: Double): Array[Array[Array[Array[Float]]]]
Split an image into tiles
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()