Instructions to use Sky-Kim/com.sky.sentis.neurosync with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- unity-sentis
How to use Sky-Kim/com.sky.sentis.neurosync with unity-sentis:
string modelName = "[Your model name here].sentis"; Model model = ModelLoader.Load(Application.streamingAssetsPath + "/" + modelName); IWorker engine = WorkerFactory.CreateWorker(BackendType.GPUCompute, model); // Please see provided C# file for more details
- Notebooks
- Google Colab
- Kaggle
Download Runtime/NeuroSyncPostProcess.cs from Sky-Kim/com.sky.sentis.neurosync: direct link, hf CLI and curl.
- Browser
- Download file 1.17 kB
-
https://huggingface.co/Sky-Kim/com.sky.sentis.neurosync/resolve/main/Runtime/NeuroSyncPostProcess.cs
- Command line
-
hf download hf://Sky-Kim/com.sky.sentis.neurosync/Runtime/NeuroSyncPostProcess.cs
-
curl -L -o NeuroSyncPostProcess.cs https://huggingface.co/Sky-Kim/com.sky.sentis.neurosync/resolve/main/Runtime/NeuroSyncPostProcess.cs
1.17 kB
| using System; | |
| namespace NeuroSync | |
| { | |
| /// <summary> | |
| /// Port of the tail of audio_processing.py process_audio_features(). Frames are row-major [n, 68]. | |
| /// </summary> | |
| public static class NeuroSyncPostProcess | |
| { | |
| const int O = NeuroSyncConstants.NumOutputs; | |
| /// <summary>In place: /100 on channels 0..60, 0.1 s linear ease-in, zero_columns(). Returns <paramref name="frames"/>.</summary> | |
| public static float[] Apply(float[] frames, int n) | |
| { | |
| for (int f = 0; f < n; f++) | |
| for (int c = 0; c < NeuroSyncConstants.NumScaledChannels; c++) | |
| frames[f * O + c] /= 100f; | |
| // np.linspace(0, 1, ease)[:, None] | |
| int ease = Math.Min(NeuroSyncConstants.EaseInFrames, n); | |
| for (int f = 0; f < ease; f++) | |
| { | |
| float k = ease > 1 ? f / (float)(ease - 1) : 0f; | |
| for (int c = 0; c < O; c++) frames[f * O + c] *= k; | |
| } | |
| for (int f = 0; f < n; f++) | |
| foreach (int c in NeuroSyncConstants.ZeroColumns) | |
| frames[f * O + c] = 0f; | |
| return frames; | |
| } | |
| } | |
| } | |