Skip to content

Instantly share code, notes, and snippets.

View saccadic's full-sized avatar
🔥
Always a death march

Katsuyoshi Hotta saccadic

🔥
Always a death march
View GitHub Profile
@saccadic
saccadic / index.html
Created July 21, 2023 15:10
hls sample
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8" />
<script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
<title>hlsjs</title>
</head>
<body>
<video id="video_smaple" controls>
<script>
@saccadic
saccadic / 2D-Affine.py
Last active March 9, 2022 02:53
2次アフィン変換のサンプル
import numpy as np
# src -> [[x,y],[x,y],...,[x,y]] List型
# dst -> [[x,y],[x,y],...,[x,y]] List型
# srcとdstは同じ数である必要があり、計算の都合上で最低3点が必要
def CalcModel(src, dst):
if (len(src) != len(dst)) or (len(src) < 3) or (len(src) < 3):
return
@saccadic
saccadic / hash_authentication.py
Created February 25, 2022 07:02
ハッシュによるパスワード認証
import bcrypt
password = b"test123456"
salt = bcrypt.gensalt()
hashed = bcrypt.hashpw(password,salt)
print(hashed)
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <opencv2/opencv.hpp>
using namespace std;
static cv::Mat readCsv(string path, int w, int h) {
std::vector<std::vector<float>> vv;
@saccadic
saccadic / speaker-segmentation-tool.ipynb
Last active July 12, 2021 01:01
Speaker Segmentation Tool
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@saccadic
saccadic / DownloadGoogleDriveFile.py
Created June 10, 2021 04:36
GoogleDriveの共有ファイルをダウンロードするPythonスクリプト
## https://stackoverflow.com/questions/38511444/python-download-files-from-google-drive-using-url
import requests
def download_file_from_google_drive(id, destination):
URL = "https://docs.google.com/uc?export=download"
session = requests.Session()
response = session.get(URL, params = { 'id' : id }, stream = True)
@saccadic
saccadic / my_format.csl
Created April 11, 2021 15:32
良く使用する文献フォーマット
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="sort-only">
<info>
<title>my format</title>
<id>https://csl.mendeley.com/styles/566334571/ieee-2</id>
<link href="http://www.zotero.org/styles/ieee" rel="self"/>
<link href="https://ieeeauthorcenter.ieee.org/wp-content/uploads/IEEE-Reference-Guide.pdf" rel="documentation"/>
<link href="https://journals.ieeeauthorcenter.ieee.org/your-role-in-article-production/ieee-editorial-style-manual/" rel="documentation"/>
<author>
<name>Michael Berkowitz</name>
@saccadic
saccadic / DrawCross.hpp
Created March 14, 2021 07:59
opencvで十字を表示する
void DrawCross(cv::Mat &src, cv::Point p, float r, cv::Scalar col, float lw) {
cv::line(src, cv::Point(p.x, p.y + r), cv::Point(p.x, p.y - r), col, lw);
cv::line(src, cv::Point(p.x + r, p.y), cv::Point(p.x - r, p.y), col, lw);
}
@saccadic
saccadic / multiprocess.py
Created March 2, 2021 05:43
マルチプロセス処理のサンプル
import pandas as pd
import cv2
from tqdm import tqdm
import numpy as np
from scipy.stats import multivariate_normal
import matplotlib.pyplot as plt
import time
import pathlib
from multiprocessing import Process, Queue
import multiprocessing
@saccadic
saccadic / polyfit.cs
Last active January 24, 2021 12:14
Unityで回帰曲線を求めるサンプル(4次方程式)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using OpenCvSharp;
namespace OpenCvSharp
{
public class polyfit : MonoBehaviour
{