I used ffmpeg to scale the width to 480 pixels.
------------------------resize.bat------------------------
mkdir out
FOR %%A IN (*.jpg) DO (
c:\tools\ffmpeg\bin\ffmpeg -i "%%A" -vf "scale=-1:480" "out/%%A.jpg"
)
Hello, welcome to my blog containing some computer tips and experiments.
Wasit Limprasert
วสิศ ลิ้มประเสริฐ
YouTube
| GitHub
| Publications
Wednesday, 23 July 2014
Wednesday, 7 May 2014
Setting up a single node IPython Notebook
Install IPython
After installing IPython by sudo apt-get install ipython-notebook, we can follow the instruction here to setup a public notebook. The steps are below:note: this works for my old desktop
$ sudo apt-get install python-pip
$ sudo pip install ipython[all] --upgrade
1. create a certificate
$ openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout mycert.pem -out mycert.pem
2. generate a hashed password in IPython environment
In [1]: from IPython.lib import passwd
In [2]: passwd()
Enter password:
Verify password:
Out[2]: 'sha1:xxx:yyy'
3. create a notebook profile
$ ipython profile create wasit
4. edit /home/ubuntu/.ipython/profile_wasit/ipython_notebook_config.py by the following code:
c = get_config()
c.IPKernelApp.pylab = 'inline'
c.NotebookApp.certfile = u'/home/ubuntu/.ipython/profile_wasit/mycert.pem'
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False
c.NotebookApp.password = u'sha1:xxx:yyy'
c.NotebookApp.port = 8888
c.NotebookApp.enable_mathjax = True
5. then we can start the notebook by going to particular directory and run the script
$ipython notebook --profile=wasit
or
$ipthon notebook --certfile=mycert.pem
However, the session will be terminate and we no longer run the job. In order to redirect the terminal output and keep the job run after terminating ssh, we should put the command in the 5th step in somescript.sh and run this
$ nohup ./somescript.sh </dev/null &
Monday, 16 December 2013
Mount shared folder to Ubuntu in VirtualBox
We cannot use the /media/sf_Dropbox as a mount point because of permission. Create new folder as <~/Dropbox> and mount shared folder for VirtualBox by
>>sudo mount -t vboxsf <Dropbox> <~/Dropbox>
The mount above performs by root so normal user cannot write on the folder. We can define user and group of normal user by specify uid and gid as shown below
>>sudo mount -t vboxsf -o rw,uid=1000,gid=1000 <Dropbox> <~/Dropbox>
And you can unmount by
>>sudo umount -a -t vboxsf
Tuesday, 3 December 2013
Install Qt on Ubuntu 64 bit
I just got Lenovo L330 with Windows 8. I got a secured boot lock problem that made installing Ubuntu along with Windows 8. The secure boot lock must be disabled, for more detail please go to here.
Well, this note is about preparing Qt framework in Ubuntu 64 bit. I downloaded Qt online installer for Linux 64bit. It took about 30 minutes and installed with a warning message "This should not happen". I really don't know what does the message means. The installation finished and it looks OK.
3/12/13 10:40pm
Then I'm installing the g++ compiler by
>>sudo apt-get install build-essential
Next the cmake, I found cmake in Synaptic Package Manager, installing with 3 clicks. I also need OpenCV 2.3, another 3 clicks. The size of all OpenCV packages is quite large, so please be patient, it took me 20 minutes.
We just finished installed all package required for the project.
Thursday, 24 October 2013
Storyline test!
Storyline test!
To compare, three different techniques (our method, [tanahashi] and [Munroe]) for drawing storyline chart.
Ref
[Tanahashi] Tanahashi, Y. & Ma, K.-L. Design Considerations for Optimizing Storyline Visualizations Visualization and Computer Graphics, IEEE Transactions on, 2012, 18, 2679 -2688
[Munroe] R. Munroe. Xkcd #657: Movie narrative charts. http://xkcd.com/657, December 2009.
To compare, three different techniques (our method, [tanahashi] and [Munroe]) for drawing storyline chart.
Ref
[Tanahashi] Tanahashi, Y. & Ma, K.-L. Design Considerations for Optimizing Storyline Visualizations Visualization and Computer Graphics, IEEE Transactions on, 2012, 18, 2679 -2688
[Munroe] R. Munroe. Xkcd #657: Movie narrative charts. http://xkcd.com/657, December 2009.
Marker
Marker to label the class of pixels, by Wasit Limprasert
Source files: marker.cpp, CMakeLists.txt, number.png
Requirement: OpenCV2.4.5, Cmake2.8
Description: Marker load an original image and let user label classes of pixels. The marked image is then saved into bitmap file. There are 10 classes to be selected by pressing key number 0-9. "-" and "=" are used for deleting and saving, respectively.
Source files: marker.cpp, CMakeLists.txt, number.png
Requirement: OpenCV2.4.5, Cmake2.8
Description: Marker load an original image and let user label classes of pixels. The marked image is then saved into bitmap file. There are 10 classes to be selected by pressing key number 0-9. "-" and "=" are used for deleting and saving, respectively.
Sunday, 21 April 2013
CUDA: multiple GPU setting (Ubuntu)
CUDA: multiple GPU setting (Ubuntu)
I have multiple GPUs are installed on a computer and want to make one of them do computing and another do displaying. This blog is going to tell how to set Ubuntu and code your CUDA.
Firstly, check the display devices by using a command /usr/bin/nvidia-settings. You will see installed GPUs. You can set display option here or edit a config file /etc/X11/xorg.config.
And then, we code a program to count the GPU, get info and set computing GPU by folowing command:
1. cudaGetDeviceCount(int* NumberOfGPUs); to count nymber of GPUs
2. cudaGetDeviceProperties(&deviceProp,GPU_ID);
3. cudaSetDevice(GPU_ID);
Example code:
I have multiple GPUs are installed on a computer and want to make one of them do computing and another do displaying. This blog is going to tell how to set Ubuntu and code your CUDA.
Firstly, check the display devices by using a command /usr/bin/nvidia-settings. You will see installed GPUs. You can set display option here or edit a config file /etc/X11/xorg.config.
And then, we code a program to count the GPU, get info and set computing GPU by folowing command:
1. cudaGetDeviceCount(int* NumberOfGPUs); to count nymber of GPUs
2. cudaGetDeviceProperties(&deviceProp,GPU_ID);
3. cudaSetDevice(GPU_ID);
Example code:
int deviceNum; cudaError error; cudaGetDeviceCount(&deviceNum); cudaDeviceProp deviceProp; //struct used to keep a GPU info for(int i=0;i<deviceNum;i++){ error=cudaGetDeviceProperties(&deviceProp,i); if(error)printf("Error:getting property DeviceID:%d ErrorCode:%d\n",i,error); printf("Device %d: %s\n",i,deviceProp.name); } cudaSetDevice(SELECTED_ID);
Subscribe to:
Posts (Atom)