Instructions to use frankdu/SD-Turbo-LiteRT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LiteRT
How to use frankdu/SD-Turbo-LiteRT with LiteRT:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
File size: 763 Bytes
d4cc937 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | """java.util.Random.nextGaussian stream used by the Android image pipelines."""
import math
import numpy as np
def java_noise(seed, count):
state = (int(seed) ^ 0x5DEECE66D) & ((1 << 48) - 1)
def bits(n):
nonlocal state
state = (state * 0x5DEECE66D + 0xB) & ((1 << 48) - 1)
return state >> (48 - n)
def uniform():
return ((bits(26) << 27) + bits(27)) / (1 << 53)
out = []
while len(out) < count:
x, y = 2 * uniform() - 1, 2 * uniform() - 1
radius = x * x + y * y
if radius >= 1 or radius == 0:
continue
scale = math.sqrt(-2 * math.log(radius) / radius)
out.extend((x * scale, y * scale))
return np.asarray(out[:count], np.float64).astype(np.float32)
|