Skip to content
za4emPublic

About

Text to emoji

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

37 Commits

Folders and files

Repository files navigation

Meowmoji 🐱

Meowmoji turns a short phrase into an animal emoji. The model runs on the device through LiteRT. The model and LiteRT ship with Meowmoji.

The first match compiles the model for the selected chip, CPU or GPU. match returns a list of emoji and a score, highest first. A higher score is a better fit. Don't forget to close the model when you are done.

Meowmoji is arm64-v8a and needs Android 7 (API 24).

Install

dependencies {
    implementation("io.github.za4em:sdk:0.1.0")
}

Compose helpers:

dependencies {
    implementation("io.github.za4em:sdk-compose:0.1.0")
}

Score a phrase

Meowmoji(context, Accelerator.GPU).use { meowmoji ->
    val matches = meowmoji.match("fluffy cat")
}

Choose Accelerator.CPU or Accelerator.GPU. Ops the GPU cannot run stay on the CPU.

Compose

val meowmoji = rememberMeowmoji(Accelerator.GPU)
val matches = rememberMatchDebounced(meowmoji, text)

rememberMatchLatest scores the current phrase and cancels the previous score. rememberMatchDebounced waits for debounce, then scores. If a score is already running, it finishes.

Performance

Run the benchmark on a connected phone, or on Firebase Test Lab with gcloud. AGENTS.md has the steps, including how the results become a report. The report is benchmark/report/index.html. The result lines are in benchmark/runs/.

Meowmoji report

Screenshot

Meowmoji

License

Apache License 2.0

About

Text to emoji

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages