2018-01-01から1年間の記事一覧
[code lang='bash'] brew install octave [/code]
[code lang='python'] -- coding: utf-8 -- import os import numpy as np import glob import cv2 def generate_points_3d(rows, cols, square_size): """ prepare object points as ( 0, 0, 0), (1square_size, 0, 0), (2square_size, 0, 0), ... *1 img =…
XeLaTeXのコンパイルにIPAフォントやIPA exフォントが必要だったので,まとめ.ウェブで色々見た情報のゴッタ煮.全ユーザに有効なフォントのインストール方法なので,管理者権限が必要.IPAフォントのインストール方法が正解なのかな? フォントファイルを…
spyder --reset [code lang='bash'] Reset Spyder settings to defaults removing: C:\Users\oyamada.AR-DUNE-1.spyder-py3\spyder.ini removing: C:\Users\oyamada.AR-DUNE-1.spyder-py3\history_internal.py removing: C:\Users\oyamada.AR-DUNE-1.spyder-…
This stackoverflow post gives us the answer!! OpenCV for python installed on Linux (Ubuntu) by anaconda outputs GTK+2.x related error as OpenCV Error: Unspecified error (The function is not implemented. Rebuild the library with Windows, GT…
To compile Japanese document with xelatex, I decided to use IPA fonts. Download IPA font files files (*.ttf files) from here. Create a directory to save the font files as sudo mkdir /usr/share/fonts/truetype/ttf-ipa-font Copy the font file…
I just wrote a simple code to visualize trained filters and feature maps of pytorch. For simplicity, the below code uses pretrained AlexNet but the code must work with any network with Conv2d layers. [code lang="python"] !/usr/bin/env pyth…
See here. conda install -c anaconda opencv
OpenCV-Pythonチュートリアルの和訳を2.5年ぶりに更新. 和訳は以前と同じURLからアクセス可能です. ソースはgithubからgitlabに移行しました. 誤訳,変な訳があればgitlabにイシュー登録してもらえるとハッピーです.
run the following command from terminal $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
The following command delete all lines starting with WORD_TO_DELETE and overwrite the original file. sed -i -e '/WORD_TO_DELETE/d' FILE_NAME
Default beamer settings provide weird font equations. This problem is solved by adding the following command in preamble. \usefonttheme[onlymath]{serif}
For newbie in the lab, I'll give a seminar series on computer vision. I selected lecture slides published by Professor Shapiro. Week 1 (2018/05/11) Introduction Image and filtering Week 2 (2018/05/18) Morphology operations Edge detection (…
conda install ... opencv, conda install ... opencv-python ruined my environment built on Windows 10. The error seemed to related to PyQt and authentication/path setting but couldn't specify the true cause. So, instead of using anaconda bin…
OpenCV installation on Windows via Anaconda with conda -c conda-forge opencv makes import error like ImportError: DLL load failed: access denied. The solution is to use pip instead as pip install opencv-python.
See this. The process is super simple. stack a set of strings into a list. define a function converts a string object to its corresponding int object. define a function runs through a list to extract numbers from strings. sort a list with …
See the tutorial. Important note: torchvision provides several pre-trained models with their trained parameters. AlexNet, DenseNet, Inception, ResNet, VGG are available, see here. With pretrained=True, pre-trained parameters are available.…
I got a runtime error at evaluation phase of my simple siamese network as RuntimeError: cuda runtime error (2) : out of memory at the line of executing forward pass. Some comments on stackoverflow suggests to define x and y with volatile=T…
See spyder's issue. For my case, installing PyOpenGL fixed the error as conda install pyopengl
See this tutorial. Set requires_grad=True for all tensors we compute gradients w.r.t. them. [code lang='python'] input and output x = torch.randn(N, D_in, device=device, dtype=dtype) y = torch.randn(N, D_out, device=device, dtype=dtype) pa…
See the tutorial. It's quite simple (Keras provides simpler interface though). A neural network is defined as a class that has a forward function. The forward function defines how input data is processed through the network. PyTorch automa…
Super easy installation GUI on the web as below
Inspired by this stackoverflow answer and keras.callbacks.CSVLogger, I implemented a callback function to save loss on each batch. [code lang='python'] class LossHistory(Callback): def __init__(self, filename, separator=',', append=False):…
If Leap Motion SDK installation failed with dpkg command, the site gives you the answer. Before running sudo dpkg --install Leap-*-x64.deb, we should first make a file /lib/systemd/system/leapd.service with the following contents. Otherwis…
ネイティブに笑われないクールイングリッシュ ―日本人の9割はダサい英語を話している サマー・レイン インプレス イケてない英語表現について,何が問題でどのような表現にするべきか説明してくれているありがたい本.英語で誰かとコミュニケーションする機…
I got "ImportError of libcudnn.so.6" after Ubuntu apt update although I have no idea how apt update causes the error. The solution is re-install cuDNN. Library files of cuDNN disappeared from a directory where is one of LD_LIBRARY_PATH. So…