Skip to content

Instantly share code, notes, and snippets.

View esnya's full-sized avatar

esnya

  • Japan
View GitHub Profile
@esnya
esnya / lhbs-manager.py
Created August 14, 2023 10:50
LighthouseのBaseStationを電源状態を取得したりonにしたりsleepにしたりできるやつ。
import asyncio
import logging
from enum import Enum
from typing import Optional
# pip install bleak
from bleak import BleakClient, BleakScanner, BLEDevice
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
@esnya
esnya / easy_anime_face_expressions.py
Created July 17, 2023 17:59
Custom script for AUTOMATIC1111/stable-diffusion-webui to generate face expressions of anime characters. Powered by cascade classifier from nagadomi/lbpcascade_animeface.
"""
Easy Anime Face Expressions
Custom script for AUTOMATIC1111/stable-diffusion-webui to generate face expressions of anime characters.
Powered by cascade classifier from nagadomi/lbpcascade_animeface.
Usage:
1. Download this file to `scripts/easy_anime_face_expressions.py`.
2. Start the webui.
3. Generate base image with "closed mouth" in prompt. (or first expression tag you will put into the textbox.)
@esnya
esnya / async_itertools.py
Last active July 15, 2023 17:27
This module provides a set of utility functions for working with async iterables.
"""
async_itertools module
This module provides a set of utility functions for working with async iterables.
It includes the following functions:
- afilter(func, iterable): Filters the given async iterable with the provided function.
- amap(func, iterable): Maps the given function onto each item of the async iterable.
- areduce(func, iterable): Reduces the async iterable to a single output with the provided function.
- achain(*iterables): Chains the given async iterables together into a single async iterable.
@esnya
esnya / jukebox.py
Created June 11, 2023 03:08
audiocraftで遊んだやつ。おおむね無限につなぎつつけるやつ。
import argparse
import asyncio
from contextlib import contextmanager
from functools import cached_property
from typing import Any, Callable, Generator, Optional, Tuple
import pyaudio
import torch
from audiocraft.data.audio import audio_write
from audiocraft.models.musicgen import MusicGen
@esnya
esnya / tts_patch.py
Created April 22, 2023 05:50
Monkey-Patch for espnet2.bin.tts_inference.Text2Speech to support pyopenjtalk 0.3 and python 3.10
# Original code: Apache License 2.0
# https://github.com/espnet/espnet/blob/master/LICENSE
# Modified by: esnya
# https://github.com/esnya
from espnet2.bin.tts_inference import Text2Speech
from espnet2.text.phoneme_tokenizer import (
pyopenjtalk_g2p_accent_with_pause,
pyopenjtalk_g2p_prosody,
)
@esnya
esnya / FogController.cs
Last active November 21, 2021 05:20
Integrate UdonChips and SaccFlightAndVehicles 1.5 as SaccAirVehicle Extention.
using UdonSharp;
using UnityEngine;
using UnityEngine.UI;
using VRC.SDKBase;
using VRC.Udon;
namespace EsnyaAircraftAssets
{
[UdonBehaviourSyncMode(BehaviourSyncMode.Continuous)]
@esnya
esnya / UdonRadioCommunication.cs
Last active August 5, 2021 08:29
Safe hotfix
using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;
#if !COMPILER_UDONSHARP && UNITY_EDITOR
using System.Collections.Generic;
using System.Linq;
using UnityEditor;
using UnityEngine.SceneManagement;
using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;
using UdonRadioCommunication;
public class PassengerSeat : UdonSharpBehaviour
{
public EngineController EngineControl;
public GameObject LeaveButton;
using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
// using InariUdon.UI;
using UCS;
namespace EsnyaAircraftAssets
{
[UdonBehaviourSyncMode(BehaviourSyncMode.NoVariableSync)]
@esnya
esnya / UdonChipsInstantShop_Trigger.cs
Created July 7, 2021 09:24
UdonChipsInstantShop Trigger
using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon.Common.Interfaces;
#if !COMPILER_UDONSHARP && UNITY_EDITOR
using System.Linq;
using System.Reflection;
using UdonSharpEditor;
using UnityEditor;
#endif