Python,PyTorch

Thumbnail of post image 061

乱数を発生させる前にtorch.manual_seedを置く

# 直前に置くtorch.manual_seed(42)nn.Parameter(torch.randn(1, 50 + 1, 768))>>Parameter co ...

Python

Thumbnail of post image 192

models = for BenchmarkModel in models: runs = [] model_name = BenchmarkModel.__name__.replace('Model', '')

Python,効率化

Thumbnail of post image 147

Pythonを実行する際の引数指定は,以下のようにyamlで行うのが効率が良いとされている.

# yamlファイルの準備(ここは普通手動で行う)content = "batch_size: 16\nwidth: 224\nhei ...

Error,Python

Thumbnail of post image 070

タイトルのエラーがでたときは、urllib.requestを代わりに使おう

import urllib.requestreq = urllib.request.urlopen("")

OpenCV,Python

Thumbnail of post image 150

以下コマンドを入力後再度opencvのインストールコマンドを入力

conda install anacondaconda update --all

albumentation,Python

Thumbnail of post image 178

Albumentationを用いてSegmentation用のコードを書いていると,条件を変えた複数の入力画像を同時にtransformしたくなる時がある.しかしながら,albumentationでは,transformの際,imag ...

OpenCV,Python

Thumbnail of post image 175

画像から特定の画素を抽出する方法として,inRange関数を使う方法が良く取り上げられるが,RGB値で色を指定したり,複雑な条件を付けて画素抽出を行う場合はNumpyによる行列操作で抽出するのが最も良い方法なのではないかと思う.

Jupyter,Python

Thumbnail of post image 181

Dockerでjupyter notebookを動かすときには,単に,jupyter notebookと打つのではなく,少々設定が必要である.

まずは設定ファイルを作成

jupyter notebook --gene ...

Deep Learning,Docker,Nvidia-docker,Python

Thumbnail of post image 016

単眼画像からの深度測定のために提案されたPackNet-Sfmをインストールするときは,dockerが推奨されている.公式のリポジトリでは,親切にmakeコマンドでdockerコンテナを構築するまでを1つのパイプラインで行うことができ ...

Jupyter,Python

Thumbnail of post image 098
from IPython.display import display, Markdown, Latexdisplay(Markdown('*some markdown* $\phi$'))display(Latex('\phi'))x = ...