Skip to content

Instantly share code, notes, and snippets.

View yektasarioglu's full-sized avatar
🤓
Working on some interesting stuff

Yekta Sarioglu yektasarioglu

🤓
Working on some interesting stuff
View GitHub Profile
var resultAction: ((SparseArray<MLText.Block?>) -> Unit)? = null
override fun transactResult(results: MLAnalyzer.Result<MLText.Block?>) {
val items = results.analyseList
// Determine detection result processing as required. Note that only the detection results are processed.
// Other detection-related APIs provided by ML Kit cannot be called.
resultAction?.invoke(items)
resultAction = null
}
// TextRecognitionViewModel
fun analyzeStream() {
if (isCameraStarted)
textRecognizer.analyzeStream {
it.forEach { _, value ->
Timber.d("stringValue is ${value?.stringValue}")
outputLiveData.postValue(value?.stringValue)
value?.contents?.forEachIndexed { index, element ->
Timber.d("[$index] is ${element.stringValue}")
// TextRecognitionViewModel
fun analyzeBitmap(bitmap: Bitmap) {
textRecognizer.analyzeBitmap(bitmap) {
Timber.d("stringValue is ${it.stringValue}")
if (it.stringValue.isEmpty()) {
outputLiveData.value = "No text recognized !!"
Timber.e("No text recognized !!")
}
using UnityEngine;
public class CharacterStateMachine : StateMachineBehaviour
{
public static CharacterAnimationState characterAnimationState;
public static BaseCharacter baseCharacter;
public static void setBaseCharacter<T>(T character) where T : BaseCharacter
{