Automatically transcribe

Reportex

The idea of Reportex is very similar to my idea of something about best audio/video editor. When you select a paragraph of words, it will automatedly select the corresponding audio clips.

But right now it is just a demo.

[TIL] 3d scanner hardware, software, app and course

Hardware

DIY 3D Scanner by Alex

In this video, Alex used stepper motors, threaded rod, IR sensor, home made 3D print components to build a DIY 3D Scanner hardware. There are three kinds of sensors can be to measure the distance, IR sensors, Ultrasonic sensors and Laser sensors.

FabScan

FabScan is an open source 3D laser Scanner hardware, you will get all the information you need to build one from here. FabScan uses a laser sensor to get the distance information for 3d reconstruction and use a camera to get the texture of the object.

There is a video show you how to Assembly it:

There is a video show you how to use it:

Software

VisualSFM

VisualSFM is a 3d scanner software, made by Changchang Wu, support Windows/Linux/Mac. You can put all the photos shotted by different angles, VisualSFM uses SIFT (Scale-invariant feature transform) method to get the feature points of photos, connect the same feature point on different photos, to get the relation of photos, to get the 3D model.

If you are interesting VisualSFM, there is a great video will show you how to use it on youtube.

PhotoScan

use PhotoScan scan photo files:

Trick

You need to use a camera or your phone to take a lot of photos of the object from all the different angles. This is very painful. I developed a trick method use my iPhone. First, I shot a short video shot every angle of the object use my iPhone, send to my Mac, use FFMPEG to convert this video to photos.

The number 6 is to extract how many frames from 1s video.

I did a lot of 3D scans, use this method.

App

MobileFusion

Microsoft’s MobileFusion app is the best app make 3D scans, but it never comes to market.

Course

If you want to write your own codes to make 3d scanning, you may want to learn this course, Photogrammetry by Cyrill Stachniss.

Cyrill Stachniss is a full professor for photogrammetry at the University of Bonn and recently became the deputy managing director of the Institute of Geodesy and Geoinformation.

Photogrammetry:

And finally, you always can go to Reddit find anything, of course, include 3D Scanning.

If you search some specific words like “Apple pie”, Google will show some different results at the first several lines, like this:

You can find out these results contain some extra contents, like rating, votes, time, and cal, Google must know these results are recipes. But how can they know? Using some deep learning algorithm? No, this is all about structured data.

Google support a lot of structured data.

1. Format is Microdata
2. Google support a lot type of structured data of enhancements, like Breadcrumbs, Corporate Contacts, Galleries and Lists, Logos, Sitelinks Searchbox, Site Name, Social Profile Links, and a lot of content types, Articles, Books, Courses, Datasets, Events, Fact Check, Local Businesses, Music, Podcasts, Products, Recipes, Reviews, TV and Movies, Videos. you can find details at Search Gallery.
3. Want to know how to use it, you can see Introduction to Structured Data.

[TIL] Integration by parts

Integration by parts or partial integration is a theorem to help us solve complex Integration problem of a product of functions. If a function can represent as a product of a function $$u(x)$$ and a derivative of a function $$u′(x)$$ , we can use integration by parts.

If $$u = u(x)$$ and $$du = u′(x) dx$$, while $$v = v(x)$$ and $$dv = v′(x) dx$$, then integration by parts states that:

$$\int_a^b u(x) v'(x) \, dx\ = [u(x) v(x)]_a^b-\int_a^b v(x) u'(x) \, dx$$.

or more compactly:

$$\int u\,dv=uv-\int v\,du$$.

This method is very useful when sometimes integration of $$v(x)u′(x)$$ is easier to find.

[TIL] Rationalizing Substitution

Rationalizing Substitution is a special type of U-Substitution, radicals in function often cause problems when integrating, use rationalizing substitution we can transform the problem to help us solve them.

For example, sometimes our function contain something like $$\sqrt{x}$$, in order to eliminate the “square root”, we can make substitution $$x = z^2$$，$$dx = 2z dz$$. Then you may can solve function’s integration easier.

U-Substitution

Today I learned U-Substitution, it is a method for finding integrals in calculus, also known as integration by substitution. Using the fundamental theorem of calculus often requires finding an antiderivative. For this and other reasons, U-Substitution is an important tool in mathematics. It is the counterpart to the chain rule of differentiation.

If you find difficult to finding an antiderivative directly, sometimes you may want use substitution $$u = ϕ(x)$$, rewrite $$f(x)dx$$ form to some function $$g(u)du$$ form and get antiderivative of $$g(u)du$$ first, and put $$x$$ in the antiderivative to get what you want at first.

For example, consider the integral

$$\int _{0}^{2}x\cos(x^{2}+1)\,dx$$

If we apply the formula from right to left and make the substitution $$u = ϕ(x) = (x2 + 1)$$, we obtain $$du = 2x dx$$ and hence; $$x dx = ½du$$

{\begin{aligned}\int _{x=0}^{x=2}x\cos(x^{2}+1)\,dx&{}={\frac {1}{2}}\int _{u=1}^{u=5}\cos(u)\,du {}={\frac {1}{2}}(\sin(5)-\sin(1)).\end{aligned}}

Deep learning researchers always think training is the core problem. Because they always lack funds to purchase the quickest machines. But Google doesn’t worry this, they just have tons of powerful machines, find resources to train a good model isn’t very hard for Google.

Win some deep learning contests isn’t the goal of Google, it is just their PR tricks. Google want to provide AI cloud services. So they kept releasing their well-trained models, Inception-v3, Word2vec, etc. Most of the customers will use API from Google’s well-trained models, like Cloud Natural Language API, Cloud Speech API, Cloud Translation API, Cloud Vision API, Cloud Video Intelligence API. Some of them will want to use models that provide by Google or other companies, or just do some fine tune. And only a little of them will want to train their model all from the beginning.

So, Google cares about service more than training, so they build TPU to speed up service, to reduce service latency.

Programming languages I ever learned.

I learn a lot of them:

1. Basic – high school
2. pascal – high school
3. C – high school
4. C++ – college
5. VisualBasic – college
6. ASP – college
7. Delphi – college
8. BCB – college
9. VC – college
10. PHP – college
11. Flash – college
12. VHDL – at wok
13. Python – at wok
14. Java – at wok
15. Matlab – at wok
16. Objective-C – at wok
17. Swift – at wok

Maybe I missed something , I am an old man now. 🙂

How to install Theano on Mac OS X EI Capitan with OpenCL support

I have two Mac, a Mac pro and Macbook pro. They both use AMD display card, so I can’t use CUDA speed up machine learning, so I want to use OpenCL.

First install some requirements:

Then make install environment ( use virtualenv can make everything easy ):

Install Theano:

Then you can use this demo code ( test.py ) to test your Theano:

This test will show something like this:

It just do some math 1000 time, took 1.492254 seconds, and use cpu.

Then we must install libgpuarray to make Theano support OpenCL:

Then we can use THEANO_FLAGS to set use OpenCL device.

Use OpenCL & Cpu in my Mac pro:

Note: Code showed “Used the gnu”, but as you can see, this was using CPU.

Use OpenCL & GPU 1 in My Mac pro:

Finally, we can use OpenCL and GPU.

Performance:

My Mac pro

My Macbook pro

Note: Now we can use Theano and OpenCL. But I was very sad, when I found out Theano is using CUNN, so when you use Theano to do Neural Network, we still need CUDA support. Just for now I don’t know how to solve this problem.