Skip to content

Instantly share code, notes, and snippets.

View aoirint's full-sized avatar
🐱

aoirint aoirint

🐱
View GitHub Profile
environment:
- DISPLAY=${DISPLAY}
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix
@aoirint
aoirint / UNet.py
Last active March 9, 2020 16:50
UNet with Bottom Layer Map scale parameter (only x1, x1/2, x1/2^2, x1/2^3, x1/2^4 support)
# Based on https://github.com/mateuszbuda/brain-segmentation-pytorch/blob/master/unet.py
# Original version is licensed under MIT License by mateuszbuda.
from collections import OrderedDict
import torch
import torch.nn as nn
class UNet(nn.Module):
<?php
$title = "";
$N = 100*3; # multiplying "3" because "あ" is 3 bytes in utf-8
# $N = 74;
for ($i=0; $i<$N; $i++) {
$title = $title . "a";
}
?>
<!DOCTYPE html>
@aoirint
aoirint / sketch_feb07a.ino
Created March 20, 2020 03:28
feb08 シリアル通信検証
float f = 100;
float amp = 255;
void setup() {
// pinMode(A0, OUTPUT);
Serial.begin(115200);
}
void loop() {
float t = (float) millis() / 1000;
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.2
// @description try to take over the world!
// @author You
// @match http://example.com/*
// @grant none
// ==/UserScript==
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aoirint
aoirint / ts.py
Created March 20, 2020 03:37
torch jit test
import torch
import torchvision.models as M
model = M.resnet18(pretrained=True)
model.eval()
# model = M.resnet50(pretrained=True)
dummy = torch.randn((1, 3, 224, 224))
trmodel = torch.jit.trace(model, dummy)
import os
import sys
import io
import subprocess
import argparse
JAVA_HOME = '/usr/lib/jvm/java-11-openjdk-amd64'
JDEPS = os.path.join(JAVA_HOME, 'bin/jdeps')
JLINK = os.path.join(JAVA_HOME, 'bin/jlink')
JMODS_DIR = os.path.join(JAVA_HOME, 'jmods')
@aoirint
aoirint / watch.py
Created March 20, 2020 03:41
File Watch (buggy)
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
import time
import os
from stat import *
class FileWatchHandler(FileSystemEventHandler):
def __init__(self, path):
self.path = os.path.realpath(path)
self.fp = None