Fetch API – was I living on Mars?

I stumbled upon Fetch API today. It’s this simple:

fetch(url)
  .then((resp) => resp.json()) // Transform the response object into json
  .then(function(data) {
    // Do what the hell I want to do with received JSON data
    })
  })

 

Seriously! I must have been living on Mars to have not noticed it earlier. XMLHttpRequest and jQuery.ajax — time to move on, ba bye!

Celebrity Recognizer and Bulma

Last Sunday, I took a beginner’s session on getting started with artificial intelligence as part of AI-Creatives meetup Code & Coffee. To get the fancy of attendees, I picked up computer vision; more specifically, image recognition using deep learning.

As time was deliberately limited (90 mins), I focused on inference more than training. Deep learning, as you know, requires time (weeks to months) and resources (specialized GPUs). I based my demo on the Tensorflow’s image retraining tutorial.

Celebrity Recognizer Website

The core idea was to quickly retrain a trained ImageNet model, and then create an API around it for inferences. This API would then be tested by using it on a webpage. I think the session went well. You can see the deck I used here. Source code for classifier, API and webpage is on GitHub.

Continue reading Celebrity Recognizer and Bulma

Coding a neural network in plain JavaScript!

Sounds completely insane, doesn’t it? Mattias Petter Johansson (mpj) has done just that. The best part is that mpj is as clueless about NN’s computer science or mathematical details as probably you are. He has posted a 3-part tutorial about it on his popular YouTube channel Fun Fun Function. I like to think of it as neural networks for JS-coding dummies!

I saw the first part. It’s fun!

Spatial Augmented Reality

It is fascinating to realize that something as simple as a shader lamp is an augmented reality generation device. A different kind of augmented reality, known as Spacial AR. While our regular AR augments real-world objects through cameras and screens on our personal phone, SAR augments real-world objects through the use of real-world projection and lighting techniques.

This reminds me of the beautiful Bundeshaus laser show I saw last year in Bern (I did not record this video).

The next time you see a plain old building beautifully illuminated at night with bright, colorful lights, do stop by and appreciate the fact that you witnessed AR without your phone!

Best way to split a paragraph into sentences

…is to not use your own brain but rather ride on the shoulders of an expert. Surprisingly enough (for most), a popular ‘expert’ is Stanford CoreNLP.

Suppose you have the following paragraph (credit):

Born in Pretoria, South Africa, Musk taught himself computer programming at the age of 12. He moved to Canada when he was 17 to attend Queen’s University. He transferred to the University of Pennsylvania two years later.

Continue reading Best way to split a paragraph into sentences