Packages

o

com.johnsnowlabs.ml.ai.util

Florence2Utils

object Florence2Utils

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Florence2Utils
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. case class BBox(bbox: Seq[Double], catName: String) extends Product with Serializable
  2. case class BBoxesResult(bboxes: Seq[BBox]) extends Florence2Result with Product with Serializable
  3. sealed trait Florence2Result extends AnyRef
  4. case class MixedResult(bboxes: Seq[BBox], bboxesLabels: Seq[String], polygons: Seq[Seq[Double]], polygonsLabels: Seq[String]) extends Florence2Result with Product with Serializable
  5. case class OCRInstance(quadBox: Seq[Double], text: String) extends Product with Serializable
  6. case class OCRResult(instances: Seq[OCRInstance]) extends Florence2Result with Product with Serializable
  7. case class PhraseGroundingInstance(bbox: Seq[Seq[Double]], catName: String) extends Product with Serializable
  8. case class PhraseGroundingResult(instances: Seq[PhraseGroundingInstance]) extends Florence2Result with Product with Serializable
  9. case class PolygonInstance(polygons: Seq[Seq[Double]], catName: String, bbox: Option[Seq[Double]] = None) extends Product with Serializable
  10. case class PolygonsResult(instances: Seq[PolygonInstance]) extends Florence2Result with Product with Serializable
  11. case class PureTextResult(text: String) extends Florence2Result with Product with Serializable

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def bufferedImageToBase64PNG(image: BufferedImage): String
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  7. val colorMap: Array[Color]
  8. def constructPrompts(texts: Seq[String]): Seq[String]
  9. def convertToODFormat(mixed: MixedResult): Map[String, Any]
  10. def dequantizeBox(bins: Seq[Int], imageSize: (Int, Int)): Seq[Double]
  11. def dequantizeCoordinates(bins: Seq[Int], imageSize: (Int, Int)): Seq[Double]
  12. def drawOcrBBoxes(image: BufferedImage, quadBoxes: Seq[Seq[Double]], labels: Seq[String]): BufferedImage
  13. def drawPolygons(image: BufferedImage, polygons: Seq[Seq[Seq[Double]]], labels: Seq[String], fillMask: Boolean = false): BufferedImage
  14. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  16. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  17. def getBaseTaskToken(task: String): String
  18. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  19. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  20. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  21. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  22. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  23. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  24. def parseOCR(text: String, imageSize: (Int, Int)): Seq[OCRInstance]
  25. def parseOD(text: String, imageSize: (Int, Int)): Seq[BBox]
  26. def parsePhraseGrounding(text: String, imageSize: (Int, Int)): Seq[PhraseGroundingInstance]
  27. def parsePolygons(text: String, imageSize: (Int, Int)): Seq[PolygonInstance]
  28. def plotBBox(image: BufferedImage, bboxes: Seq[Seq[Double]], labels: Seq[String]): BufferedImage
  29. def postProcessGeneration(text: String, task: String, imageSize: (Int, Int)): Florence2Result
  30. def postProcessImage(image: BufferedImage, task: String, result: Florence2Result, textInput: Option[String] = None): Option[String]

    Post-processes an image according to the task and model output, returning a base64-encoded PNG.

    Post-processes an image according to the task and model output, returning a base64-encoded PNG.

    image

    The input BufferedImage

    task

    The task string (e.g. "<OD>", "<CAPTION_TO_PHRASE_GROUNDING>", etc.)

    result

    The post-processed Florence2Result

    textInput

    Optional text input (for phrase grounding, etc.)

    returns

    Option[String] with base64 PNG, or None if no visualization is needed

  31. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  32. val taskAnswerPostProcessingType: Map[String, String]
  33. val taskPromptsWithInput: Map[String, String]
  34. val taskPromptsWithoutInputs: Map[String, String]
  35. def toString(): String
    Definition Classes
    AnyRef → Any
  36. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  37. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped