Skip to content

Instantly share code, notes, and snippets.

View take-cheeze's full-sized avatar
💤

Takeshi Watanabe take-cheeze

💤
View GitHub Profile
@take-cheeze
take-cheeze / text.md
Last active February 23, 2023 09:54
WeActで買ったのでepaper
import torch
from torchvision.models.detection import maskrcnn_resnet50_fpn, MaskRCNN_ResNet50_FPN_Weights
weights = MaskRCNN_ResNet50_FPN_Weights.DEFAULT
transforms = weights.transforms()
model = maskrcnn_resnet50_fpn(weights=weights, progress=False)
# model = model.eval()
model = model.train()
import torch
import torch.onnx.symbolic_helper as sym_hel
from typing import Any
def _maybe_get_scalar(value: torch._C.Value) -> Any:
value_t = _maybe_get_const(value, "t")
if isinstance(value_t, torch.Tensor) and value_t.shape == ():
return value_t
node_v = sym_hel._node_get(value, "value")
@take-cheeze
take-cheeze / onnx.diff
Created April 2, 2021 07:11
onnx.diff
modified onnx/checker.cc
@@ -795,13 +795,14 @@ void check_model(const ModelProto& model, CheckerContext& ctx) {
}
void check_model(const std::string& model_path) {
- ModelProto model;
+ google::protobuf::Arena arena;
+ ModelProto* model = google::protobuf::Arena::CreateMessage<ModelProto>(&arena);
std::fstream model_stream(model_path, std::ios::in | std::ios::binary);
if (!model_stream.good()) {
name: Update book list
on:
push:
branches: [ master ]
schedule:
- cron: "0 * * * *"
jobs:
build:
document.querySelectorAll('.icon-download').forEach((v, idx) => {
setTimeout(() => {
let e = document.createElement('a');
e.href = v.parentNode.href;
e.target = '_blank';
document.body.appendChild(e);
e.click();
}, (Math.random() * 1000 + 500) * idx);
});
document.querySelectorAll('#contents_list a').forEach((v) => {
fetch(v).
then((response) => response.text()).
then((txt) => {
const parser = new DOMParser();
const src = parser.parseFromString(txt, 'text/html');
const mp4_url = src.querySelector('video source').src;
const elem = document.createElement('a');
elem.download = '';
elem.href = mp4_url;
@take-cheeze
take-cheeze / booth-total.user.js
Last active June 17, 2020 03:55
calc_booth.userscript.js
// ==UserScript==
// @name Booth Total
// @namespace https://take-cheeze.dev/
// @version 0.1
// @description try to take over the world!
// @author @take-cheeze
// @match https://booth.pm/*
// @grant none
// ==/UserScript==
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{2c4de342-38b7-51cf-b940-2309a097f518}",
"profiles":
s = 0; document.querySelectorAll('.cart-box-subtotal-price').forEach((v) => {
s += parseInt(v.innerHTML.replace(/[^0-9]/g, ''));
});
console.log(s);