MatConvNet with Visual Studio 2015.3 Toolset and MATLAB R2017a

MATLAB VS2015.3 Toolset

Introduction

After a recent re-install of Windows on my laptop, I decided to install the latest version of the software packages that I frequently use. This include MATLAB R2017a ,Visual Studio 2017 Enterprise and MatConvNet.

However, it turns out that MATLAB R2017a does not support using VS2017 out of the box (patch required). What’s worse is that CUDA Toolkit 8.0 also doesn’t support VS2017 yet.

In order to use MatConvNet for my research, I had to install VS2015.3 Toolset (optional component of VS2017) and configure MATLAB R2017a to use it.

 

System Environment

ComponentVersion
OSWindows 10 Home 1703 Build 15063.0
MATLABR2017a
CUDA Toolkit8.0.61
CuDNN5.1
Visual Studio2017 Enterprise with 2015.3 Toolset

Continue reading…

Bad Apple ASCII Javasrcipt字符画版| Bad Apple ASCII Javascript

Bad Apple ASCII 版影绘简介

Bad Apple (坏苹果) 影绘是东方同人作品中的经典,经过后期加工也出现了很多版本,其中ASCII码版的字符动画是其中一大主力,并且在各个平台都有成果:视频,网页,DOS,PSP,Telnet服务器,甚至还有启动盘。
于是出于练手的目的先用Javascript (字符动画播放)和HTML5 (音频播放)实现一番。

传送门:http://rotar.tk/ba

主要工具

  1. 帧提取:Free Video to JPG Converter
  2. 字符化:ASC GEN 2.0
  3. 抽音轨:Free Video to MP3 Converter

体会

目前从效果来说马马虎虎过得去,3:39的动画源文件15.9MB,按30FPS的帧率抽出一共6572帧66.5MB,转成80×35的字符是17.9MB,自己再进行压缩到4.38MB,最后经过PHP的GZip能压缩到1.4MB。

影音不同步是个大问题,目前在想办法解决,大致的办法是使用Audio的currenttime这个属性来计算当前应该达到的帧并且修改帧的索引值。

本来是想用C++来写的,结果发现长时间未使用(plus根基不牢)竟然连读取txt文件都成了大问题,果断要找时间补课了。

Update 2012.08.15

测试了一下IE各版本下的表现,果然差得惊人。于是对IE进行了特殊处理,包括以下:

  1. 把” “(空格)改成” ”
  2. “\n”换成”<br />”
  3. IE7以下版本对于没有内容的”<br />”会直接忽略,于是只得在前添加一个”&nbsp;”
  4. 由于IE不支持ogg格式,当检测到是IE时,跳过音频控制并”建议使用Chrome” XD

Update 21:18

多浏览器支持果然是门学问,这次本以为只有IE会成问题,没想到换成火狐(Firefox)试了试出现了因为字体不是等宽(Monospaced)而产生的严重错位。问题的根源在于之前给pre的标签(tag)在CSS中设置的字体只有一个Courier,这在Win7和iOS上都没问题,可是Firefox并没有这个字体,所以才使用默认字体顶替以至于排版混乱。刚更新的CSS已经添加了6个等宽字体以确保任何系统下都能正常显示。

此外,刚把Chrome的22 Dev版下了来测试发现页面的声音出不来,起因不明,准备再下个21的Beta做对比。

PMangar再启动计划 | Revival of PMangar

大概是从去年开始着手制作了一个简陋的看漫画用的php网站PMangar,功能只有通过股沟在178上面搜索与输入字符相关的漫画,然后一页一张图的方式进行浏览,当时在Kindle和手机上测试效果都还凑合,于是就收工了。近来无事,于是又测试了一下,发觉功能基本失效,于是重新检查和改进,总算是又能恢复使用了。传送门在此:http://rotar.tk/pm

本文便用来记录复活PMangar过程中的领悟和心得,与诸君共勉。

————————–Lang Sep—————————–

PMangar was an simple php application that fetches comics from 178.com and display it to the user. In other words, its just an online comic viewer. The work are considered done in last year as the result of using it on both Kindle and my Nokia phone seems to be satisfactory. However, when I checked the application few days ago, nothing seems to be working and therefore I’m here to repair and upgrade it. The currently working version is available at http://rotar.tk/pm.

This post intend to share what I’ve learnt about php during the process and hope it may help.

Continue reading…

这学期要忙起来了| Getting busy this semester

于是学期开始一周后就要交两份报告,同时另外两门的作业也布置下来了,加上硕士申请以及Project的研究……基本是杯具了。

接下来这段时间可能会延续这一个月来的风格,博文更新什么的速度会很慢。

顺带感慨一下,英国这边的某些家伙素质还真不高。一到晚上就泡进酒吧,出来的时候就已经是傻冒了,经过楼下喜欢大声放歌,随地小便以及踹垃圾桶在这群人的帮助下,俺们楼下4个垃圾桶的位置几乎是每日变换一个花样,令人叹为观止。

—————————–Lang Sep————————————

The busy semester has started and we are having two reports to hand in in the second week with another two assignment to do in the following weeks. I would also need to work on my project as well as my postgraduate application.

Because of all the aforementioned tasks, this blog will not be updated frequently.

BTW, I’m pretty amazed at the behaviors of some group of people here in Preston. According to what they have done, it isn’t difficult to classify them as ‘drunkard’. Singing loud, peeing by the street and smashing garbage bins, this is like their daily routine after drinking too much in bars. With the great help of these people, the 4 of our trash bins have been changing locations daily.

Python 笔记01| Notes about Python 01

近几日花了挺多时间在这上面,效果也较为显著,PMangar基本被实现了。期间有一些心得在这儿写下来做记录,顺便也分享:
I’ve been working on Python these days and here are some notes for it:

  1. Python中不支持在string.find(str)中使用正则表达式,即str只能是string。
    str in string.find(str) can not be a regular expression, it should be a string.
    Code:

  2. 使用for i in range(a,b)时,i的值可以等于a到不b-1而不会等于b。同理对于i[a:b]会截取i的第a至b-1个元素。
    In Python, any operation involving a range of a to b means the value can be from a to b-1.
    Code:

  3. 当已知一个字符的Unicode编码时,例如a=”u4eba”,可以通过unichr()和int()将其转换为相应字符的Unicode形式即b=”u4eba”
    When you know the unicode number of a charactor, you can get the corresponding character by using unichr() and int().
    Code:

学校图书馆真吵| University library is really noisy

转眼十数年过去,小学,初中,和高中都已经成为历史,而大学生涯也仅剩最后一年。怀着满腹希望的俺来到英国接受第三年的学习和生活。临行之前便听了讲座,意识到了出国学习可能面临的“文化冲击”。

于是到来之后保持着谨慎的态度接受着“异国风情”的熏陶。所幸近几个月内并未感到什么冲击,但是值得一提的就是国外大学的图书馆。回顾以往,自小受到的教育就告诉我们:图书馆是一个安静的地方。无论是老师们的嘱咐,图书馆管理员的神情,还是墙上挂着的大大的“静”字都无时无刻的提醒着我们。作为结果,俺自以为养成了在图书馆能够保持安静的好习惯。
Continue reading…

雅思啊| IELTS…

眼看着雅思在即,预先的练习变得必不可少,于是总算是开始动笔了。早上写了一篇Part 2,回顾一下感觉到了问题,词语依然贫乏,同一个物体找不到多种表达方式。而且结构上也有些问题,之前在UCLan接受的教育已经使得自身对于”The objective of this essay is to…”产生了依赖而导致结构僵硬。练习仍要增加,并且需要有意识地模仿一些高分范文了。

——————Lang Sep———————-

The IELTS exam is coming closer and I finally started practicing. The first practice is a Part 2 writing. As I reviewed it after finishing, I found the lack of expression because same words are used repeatedly to describe the same thing. There’s also some problem with the structure since I’ve been accustomed to use the sentence “The objective of this essay is to…” as I was taught in the past two years in UCLan. It seems that more practice need to be done and I shall focus on high rank model articles and learn from them to improve my own skills.

总算在64位Win7下VS2010里把OpenCV 2.1运行库正确地编译安装完了(附安装指南)| Finally finished building the correct OpenCV 2.1 libraries in Visual Studio 2010 under Windows 7 64bit (Install guide added)

由于Project需要用到OpenCV的库,所以折腾数周,总算搞定了,期间试了无数次,OpenCV的库每次都能在Debug和Release下全部编译成功。但自己新建的工程无论如何修改配置都会出现LNK的fatal error,股沟多次得出结论:库文件添加错误。但是对照之后发现一模一样,于是郁闷多日不得解。今日再做尝试,在CMake中选择了“Visual Studio 2010”而不是之前的“Visual Studio 2010 Win64”,generate,然后打开VS进行Rebuild,添加到自己的工程之后奇迹般的成功了。于是在此记上一笔,免得他人步上俺的后尘。末尾附上英文安装过程。

————————–Lang Sep——————————–

I’ve been trying to get OpenCV installed on my laptop for a couple of weeks. I’m in need of it because of my project. The installation needs the OpenCV source files to be compiled into libraries and then will it be used in my own C project. I’ve tried several times of compiling and all results showed me that the building was successful. However, when I use the files in my own project, Visual studio kept telling me ‘LNKXXXX fatal error’ and never build my program. I was about to despair of trying it on Win7 64bit when I gave it a last try. This time, I selected “Visual Studio 2010” in the configure rather than “Visual Studio 2010 Win64” as I previous did. The result was amazing. After the libraries were generated, I managed to build my program and run it. Here’s the process for vs2010:

Continue reading…