Skip to content

Instantly share code, notes, and snippets.

View kotobuki's full-sized avatar

Shigeru Kobayashi kotobuki

  • Institute of Advanced Media Arts and Sciences [IAMAS]
  • X @kotobuki
View GitHub Profile
@doraTeX
doraTeX / ocr.sh
Last active April 19, 2024 13:04
A shell script to perform OCR on images/PDFs using macOS built-in OCR engine
#!/bin/bash
SCRIPTNAME=$(basename "$0")
function realpath () {
f=$@;
if [ -d "$f" ]; then
base="";
dir="$f";
else
base="/$(basename "$f")";
@rain-1
rain-1 / llama-home.md
Last active May 25, 2024 08:46
How to run Llama 13B with a 6GB graphics card

This worked on 14/May/23. The instructions will probably require updating in the future.

llama is a text prediction model similar to GPT-2, and the version of GPT-3 that has not been fine tuned yet. It is also possible to run fine tuned versions (like alpaca or vicuna with this. I think. Those versions are more focused on answering questions)

Note: I have been told that this does not support multiple GPUs. It can only use a single GPU.

It is possible to run LLama 13B with a 6GB graphics card now! (e.g. a RTX 2060). Thanks to the amazing work involved in llama.cpp. The latest change is CUDA/cuBLAS which allows you pick an arbitrary number of the transformer layers to be run on the GPU. This is perfect for low VRAM.

  • Clone llama.cpp from git, I am on commit 08737ef720f0510c7ec2aa84d7f70c691073c35d.
@ayakix
ayakix / cocoa_log.md
Last active August 30, 2020 05:44
COCOA(接触確認アプリ)のコンタクト情報をグラフ表示

ログファイルの出力

iOS版

iOSの設定 > プライバシー > ヘルスケア > COVID-19接触のログ記録 > 一番下の 接触チェックの記録を書き出す > AirDropやメールでPCに送る。

プロット

  1. https://colab.research.google.com/ を開き
  2. ファイル > ノートブックを新規作成
  3. 左側ペインメニューのフォルダ > アップロードアイコンをクリックし、ログファイルをアップロード
  4. 下記コードを入力し、▶の再生ボタンをクリック
@solace
solace / edl2timeline.py
Last active April 5, 2022 08:25
Convert DaVinci Resolve marker edl to YouTube usable timeline
"""
Check out STEAM Powered (https://steampoweredshow.com/) where I have conversations
with women in STEAM to learn a bit about what they do and who they are.
https://www.steampoweredshow.com/learn-more
"""
from pprint import pprint
from collections import OrderedDict
import sys
import re
@anoken
anoken / m5stickc_arduino.ino
Last active February 11, 2022 13:51
M5StickCViewer_for_UnitV
// Copyright (c) 2019 aNoken
#include <M5StickC.h>
HardwareSerial serial_ext(2);
typedef struct {
uint32_t length;
uint8_t *buf;
} jpeg_data_t;
jpeg_data_t jpeg_data;
@Shinichi-Ohki
Shinichi-Ohki / boot.py
Last active February 5, 2022 07:35
M5StickVのバッテリ電圧と放電電流を取得
import lcd
import utime
import sys
from machine import I2C
from Maix import GPIO
from fpioa_manager import *
i2c = I2C(I2C.I2C0, freq=400000, scl=28, sda=29)
# And a short delay to wait until the I2C port has finished activating.
utime.sleep_ms(100)
@woudsma
woudsma / retrain-mobilenet-for-the-web.md
Last active November 1, 2022 05:09
Retrain a MobileNet model for the web with TensorFlow for Poets and TensorFlow.js

Retrain a MobileNet model and use it in the browser with TensorFlow.js

DRAFT

Combining TensorFlow for Poets and TensorFlow.js.
Retrain a MobileNet V1 or V2 model on your own dataset using the CPU only.
I'm using a MacBook Pro without Nvidia GPU.

MobileNets can be used for image classification. This guide shows the steps I took to retrain a MobileNet on a custom dataset, and how to convert and use the retrained model in the browser using TensorFlow.js. The total time to set up, retrain the model and use it in the browser can take less than 30 minutes (depending on the size of your dataset).

Example app - HTML/JS and a retrained MobileNet V1/V2 model.

@georgeyjm
georgeyjm / index.html
Last active August 31, 2018 14:18
Interactive Logistic Regression with TensorFlow.js + p5.js
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<style>
* {margin: 0}
</style>
@glasslion
glasslion / vtt2text.py
Last active May 11, 2024 21:24
This script convert youtube subtitle file(vtt) to plain text.
"""
Convert YouTube subtitles(vtt) to human readable text.
Download only subtitles from YouTube with youtube-dl:
youtube-dl --skip-download --convert-subs vtt <video_url>
Note that default subtitle format provided by YouTube is ass, which is hard
to process with simple regex. Luckily youtube-dl can convert ass to vtt, which
is easier to process.
@keijiro
keijiro / ShaderGraphExamples.md
Last active May 7, 2023 05:40
Shader Graph Examples インストラクション

※画像内の文字が見にくい場合はクリックして拡大してください。

必要なもの

Shader Graph を編集するには

既存のファイル(拡張子.ShaderGraph)をダブルクリックするとエディタが開きます。