Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Work from home

Koki Ibukuro asus4

:octocat:
Work from home
View GitHub Profile
@asus4
asus4 / tf-lite-unity-sample-Resize.shader
Created Jun 14, 2020
tf-lite-unity-sample Resize.shader
View tf-lite-unity-sample-Resize.shader
Shader "Hidden/TFLite/Resize"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
Cull Off
ZWrite Off
@asus4
asus4 / checkaudioloudness.ipynb
Created Mar 18, 2020
CheckAudioLoudness.ipynb
View checkaudioloudness.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@asus4
asus4 / pickdominantcolor.ipynb
Created Mar 3, 2020
PickDominantColor.ipynb
View pickdominantcolor.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View sample-TFL-Unity-Metal.cs
void Start()
{
// Option
var options = new Interpreter.Options()
{
// Multithread
threads = 2,
// Metal option
gpuDelegate = new MetalDelegate(new MetalDelegate.Options()
{
View sample-TFL-Unity-MNIST.cs
// the image 28 * 28 grayscale
float[,] inputs = new float[28, 28];
// the array of probability
float[] outputs = new float[10];
void Start()
{
// Read bytes from model and make Interpreter
interpreter = new Interpreter(File.ReadAllBytes(path));
@asus4
asus4 / NativeArrayExtension.cs
Last active Jun 10, 2020
NativeArray -> byte[] , byte[] -> NativeArray
View NativeArrayExtension.cs
using Unity.Collections;
using Unity.Collections.LowLevel.Unsafe;
namespace ARKitStream.Internal
{
public static class NativeArrayExtension
{
public static byte[] ToRawBytes<T>(this NativeArray<T> arr) where T : struct
{
var slice = new NativeSlice<T>(arr).SliceConvert<byte>();
@asus4
asus4 / NativeArrayExtension.cs
Last active Oct 29, 2019
Safe Conversion of NativeArray <-> byte[] in Unity
View NativeArrayExtension.cs
using Unity.Collections;
public static class NativeArrayExtension
{
public static byte[] ToRawBytes<T>(this NativeArray<T> arr) where T : struct
{
var slice = new NativeSlice<T>(arr).SliceConvert<byte>();
var bytes = new byte[slice.Length];
slice.CopyTo(bytes);
return bytes;
@asus4
asus4 / Vimeo.vue
Created Apr 26, 2019
No cookie Youtube.vue and Vimeo.vue for website in EU
View Vimeo.vue
<template lang="pug">
.vimeo
.player(ref="player")
</template>
<script lang="ts">
import { Component, Prop, Vue } from 'vue-property-decorator'
import Player, { Options } from '@vimeo/player'
// Vue wrapper for
@asus4
asus4 / WindowFunction.cs
Created Mar 3, 2019
Custom implementation of Unity FFT Window Function
View WindowFunction.cs
using UnityEngine;
namespace Fourier
{
public static class WindowFunction
{
// Implementation of Unity FFT Window Functions
// https://docs.unity3d.com/ScriptReference/FFTWindow.html
@asus4
asus4 / PCA9622.py
Created Jul 26, 2018
Control PCA9622 I2C LED Driver from Raspberry PI
View PCA9622.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" PCA9622 """
from __future__ import print_function
import time
import smbus