2023-01-01から1年間の記事一覧

Pytorchで衛星画像のセマンティックセグメンテーション

github.compytorch.orgwww.kaggle.comtowardsdatascience.comcuicaihao.com

Pytorchでセグメンテーションを行う

note-tech.comgithub.com

EOPatchの保存と読み込み

EOPatchの保存 eo-learn.readthedocs.io from eolearn.core import OutputTask, SaveTask, linearly_connect_tasks save = SaveTask("io_example") output_task = OutputTask("eopatch") from eolearn.core import LoadTask load = LoadTask("io_example") n…

eo-learnのProcessing APIを用いてSentinelのeopatchデータをダウンロードする

以下のコードが動いた。 eo-learn.readthedocs.io環境はdockerのsentinelhub/eolearn:latestを用いたeo-learnのバージョンは分からなかった。__version__属性がない?? from eolearn.core import __version__ print(__version__) ImportError: cannot impor…

Pytorchでモデルを読み込んでアーキテクチャをダンプする

import torch import torchvision device = torch.device('cuda') if torch.cuda.is_available() else torch.device('cpu') model=torchvision.models.detection.maskrcnn_resnet50_fpn(pretrained=True) model.load_state_dict(torch.load("oms_rcnn_weight…

waldnerf/decodeを動かす

github.com 以下の修正を加える examples/demo_instance_segmentation.ipynb - from decode.postprocessing import InstSegm + from postprocessing.instance_segmentation import InstSegm with rasterio.open(fn_preds,'r') as src: - r_xtt, r_bnd, r_dst…

近似直線位相IIRフィルタの時間領域設計(カルマンフィルタ利用)

こんな感じのカルマンフィルタで設計する。 計算したところ、あんまりうまくいかなかった。あとカルマンフィルタでやる必要あるのか?という点がいまいち納得できていない。 clear; close all; %Parks-McCllelan法による低域FIRフィルタの設計 wc = pi/2; wd…

MATLABでParks-McCllelanアルゴリズムを用いたFIRフィルタの設計

MATLABのfirpm()関数を使う。 コツはなるべく少ない点数でリファレンスとなる理想フィルタの挙動を指定すること。この例では4点を用いている。試しに30点でやるとリプルが非常に大きくなる。 追記:分割数が問題というより、刻みを大きくすると転移域の傾斜…

双一次Z変換によるチェビシェフIIRフィルタの設計

clear; close all; syms w; chebyshev = @(c1,c0) 2*w*c1 - c0; c0 = 1; c1 = w; cs = [c0 c1]; for n=2:10 cn_prev = cs(n-1); cn = cs(n); cn_next = chebyshev(cn, cn_prev); cs(end+1) = cn_next; end n = 8; xis = [0.1 0.5 1.0]; syms s z; T = 1e-4; …

双一次Z変換によるバタワースフィルタを利用したIIRフィルタの設計

ポイント プリワーピングによって、求めたいディジタルフィルタの遮断周波数fdをリファレンスとなるバタワースフィルタの遮断周波数faにあらかじめ変換しておく 伝達関数G(s)を求めたあと、s->zの双一次Z変換を行い、H(z)を求める clear; close all; T = 1e-…

ミニマックス法(Parks-McCllelanのアルゴリズム)によるFIRフィルタの設計

clear; close all; global delta_p delta_s; delta_p = 1; delta_s = 1; global wc; wc = 0.5*pi; wd = 0.6*pi; N = 31; M = (N-1)/2; %STEP1: ωiを初期化 %ωiを初期化: 当分割 epsilon = 0.001; if mod(M,2)==1 %M=奇数 wi_left = linspace(0+epsilon,wc,(M…

アナログフィルタとディジタルフィルタの比較

わかりやすい https://tech-blog.cerevo.com/archives/10159/

最小二乗法によるFIRフィルタの設計

clear; close all; N = 61; A = 0; b = 0; syms w; M = (N-1)/2; c = [w];%dummy for n=1:M c(end+1) = 2*cos(w*n); end c(1) = 1; c = fliplr(c); c = transpose(c); omega = linspace(0, pi, N+1); %遮断周波数の定義 delta_w = 0.1*pi;%転移域の幅 wc = 0…

窓関数をかけたディジタルフィルタ(LPF)の振幅特性

以下の3つのコードをマージする。 (理想ディジタルフィルタ(LPF)、カイザー窓関数、ドルフ・チェビシェフ窓関数) seinzumtode.hatenadiary.jp seinzumtode.hatenadiary.jp seinzumtode.hatenadiary.jp clear; close all; wc = pi/2; T = 1; % N=61; N=1…

カイザー窓の時間特性・周波数特性

clear; close all; % alpha = 0;%方形窓のときα=0 % alpha = 5.4414;%ハミング窓のときα=5.4414 % alpha = 8.885;%ブラックマン窓のときα=8.885 N = 127; M = (N-1)/2; n = -M:M; T=1; A =@(alpha) alpha * sqrt(1-(2*n/(N-1)).^2); Den =@(alpha) besseli(0…

ドルフ・チェビシェフ窓の時間特性・周波数特性

N=9(M=4)の場合、は以下のようになる。 k/n -4(=-M) -3 -2 -1 0 1 2 3 4(=M) 0 0 0 0 0 1 0 0 0 0 1 0 0 0 γ/2 γ-1 γ/2 0 0 0 2 0 0 γ^2/2 2γ^2 2(γ^2-2γ+1) 2γ^2 γ^2/2 0 0 3 0 □ □ □ □ □ □ □ 0 4=M □ □ □ □ □ □ □ □ □ clear; close all; N = 129; % N = …

窓関数の時間特性と周波数特性

clear; close all; %%%%%%%%%% Time domain %%%%%%%%%%%%%%%% T=1; N=128; w1 = []; for n=0:N-1 w1(n+1) = 1; end plot(1:N,w1,'DisplayName','Rectangular'); hold on; %Hamming window w3 = []; for n=0:N-1 w3(n+1) = 0.54-0.46*cos(2*n*pi/(N-1)); end …

AWSに課金アラートを設定

qiita.com

field-delineationのコードをeo-learnのdockerで動かす

field-delineationを動かしたい github.comeolearnのdockerを起動 docker pull sentinelhub/eolearn:latest docker run -p 8888:8888 sentinelhub/eolearn:latesteolearnが動かなかったので一度アンインストール github.com pip list | grep 'eo-learn-' | a…

ディジタルフィルタの振幅特性

リファレンスとなる理想アナログフィルタの伝達関数Gを定義 →理想アナログフィルタを逆フーリエ変換して理想アナログフィルタの時系列信号g(t)が求まる →欲しいディジタルフィルタHのインパルス応答hkが求まる(hk=T•g(kT)の関係式より) →hkとZ変換の関係式…

ディジタルフィルタのインパルス応答

clear; close all; wc = pi/8; T = 1; N=61; l = (N-1)/2; ks = 1:N; h1 = []; h2 = []; h3 = []; h4 = []; w0 = pi/2; for kprime = ks k = kprime-1; hk1 = wc*T/pi*sin((k-l)*wc*T)/(k-l)/wc/T; h1(end+1) = hk1; hk2 = -wc*T/pi*sin((k-l)*wc*T)/(k-l)/w…

GUIで衛星画像を処理できるstreamlit-geospatial

テネシー大学のQiusheng Wu が開発したインタラクティブなGIS環境 streamlit-geospatial github.comGoogle Earth Engine (GEE)のフロントエンドとも言える使い方 $ streamlit run app.py

第1種チェビシェフフィルタの振幅特性

clear; close all; syms w; chebyshev = @(c1,c0) 2*w*c1 - c0; c0 = 1; c1 = w; cs = [c0 c1]; for n=2:10 cn_prev = cs(n-1); cn = cs(n); cn_next = chebyshev(cn, cn_prev); cs(end+1) = cn_next; end n = 5; xis = [0.1 0.5 1.0]; for idx=1:length(xis…

第1種チェビシェフフィルタの位相特性

clear; close all; s = tf('s'); syms w; xis = [0.1 0.5 1.0]; n = 5; for idx=1:length(xis) xi = xis(idx); e = sqrt(10.^(xi/10)-1); tmp = sqrt(1+e^(-2))+e^(-1); sinhv = 1/2*(tmp^(1/n)-tmp^(-1/n)); coshv = 1/2*(tmp^(1/n)+tmp^(-1/n)); H_gain = …

バタワースフィルタの振幅特性・位相特性

clear; close all; s = tf('s'); Ns = [5,8,10]; syms w; for idx = 1:length(Ns) n = Ns(idx); D = 1; H_gain = 1; H_phi = 0; for jdx=1:n j = jdx; sigma_j = -sin((2*j-1)/(2*n)*pi); omega_j = cos((2*j-1)/(2*n)*pi); sj = sigma_j + i*omega_j; D = D…

バタワースフィルタのインパルス応答

clear; close all; s = tf('s'); Ns = 1:8; for idx = 1:length(Ns) n = Ns(idx); D = 1; for jdx=1:n j = jdx; sigma_j = -sin((2*j-1)/(2*n)*pi); omega_j = cos((2*j-1)/(2*n)*pi); sj = sigma_j + i*omega_j; D = D*(s-sj); end H = 1/D; subplot(4,2,n)…

0.5dBチェビシェフフィルタのインパルス応答

clear; close all; s = tf('s'); xi = 0.1; e = sqrt(10.^(xi/10)-1); tmp = sqrt(1+e^(-2))+e^(-1); theta = 0:0.1:2*pi; x = cos(theta); y = sin(theta); for n=1:9 D = 1; for k=1:n sinhv = 1/2*(tmp^(1/n)-tmp^(-1/n)); coshv = 1/2*(tmp^(1/n)+tmp^(-…

第1種チェビシェフフィルタの極

ξ=0.5dB, 1≤n≤9 clear; close all; s = tf('s'); xi = 0.1; e = sqrt(10.^(xi/10)-1); tmp = sqrt(1+e^(-2))+e^(-1); theta = 0:0.1:2*pi; x = cos(theta); y = sin(theta); for n=1:9 D = 1; for k=1:n sinhv = 1/2*(tmp^(1/n)-tmp^(-1/n)); coshv = 1/2*(t…

第1種チェビシェフフィルタの極

ξ=0.5d, 1≤n≤9 clear; close all; s = tf('s'); xi = 0.1; e = sqrt(10.^(xi/10)-1); tmp = sqrt(1+e^(-2))+e^(-1); theta = 0:0.1:2*pi; x = cos(theta); y = sin(theta); for n=1:9 D = 1; for k=1:n sinhv = 1/2*(tmp^(1/n)-tmp^(-1/n)); coshv = 1/2*(tm…

⌘+\でPDFロックを解除する

修正したlittlebirdy /usr/local/bin/littlebirdy #!/bin/bash set -e # Copyright (c) 2012 Jake Petroules. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that …