Wednesday 23 December 2015

Nimble Explorer

Nimble Explorer is a small website I've knocked up which allows you to search for packages for the Nim language contained in the its package manager Nimble. It's written almost entirely in JavaScript and Nimble, making use of JSONP to retrieve the Nimble's JSON file from Github with a backend which caches the JSON file for browsers which do not support JSONP properly as a fall-back.

It uses Fuse.js to power its search, and explorer.js (the front-end JS file for nimble-explorer) enhances this somewhat by implementing a search narrowing mechanism (specified by space separated words) and searching for tags. The search mechanism was quite easy to work with, although required some tweaking before it worked sensibly.

At this point it's quite usable, and will even work in many browsers in Google's cached version of the page (which is useful in case Linode, my host, decides to perform some surprise maintenance).

This is also the first time I've set up a web deployment mechanism using Git and it's working very smoothly which is nice

Monday 23 November 2015

HOG+SVM for gun detection in CCTV images

I have made a small collection of training data (currently around 18 images images, in two sets of 9 of people with guns and people without guns) and have made a basic implementation which attempts to guess whether somebody has a gun using support vector machines based off of 128x128 CCTV camera stills of people either carrying a gun or not carrying a gun. The present implementation appears to overfit the data so I will attempt to resolve this; it always correctly classifies everything in the training set but usually errs to the side of false negatives when  classifying test data from casual observation.

Progress to be made on this:

Collect more images (ideally 50 with guns, and I can take the rest of the images from pre-existing person reid datasets like ViPER - edit: may need some images from scenes in which guns appear in case the detector becomes influenced by the lighting/other composition of the scene.)

Find out how to regularise(?)/prevent overfitting in the model I've come up with

Formalise the analysis stage.

The source code for this version of the program can be found here:

http://pastebin.com/nz5cQx3k

To be honest, you can get rid of that opencv dependency.

Sunday 22 November 2015

An eye for guns

In my upcoming series of posts, I will be exploring ways to automatically detect armed attackers in CCTV feeds using Python and OpenCV. Of course I'm sure the motivation for this given the recent terrorist attacks in Paris, Mali and others is obvious. The scope of this is currently quite broad, so I will attempt to narrow it down to some key points:


  • Reliable detection of an AK-47/Kalashnikov rifle from a low quality video feed.
    •  The motivation for this should be self explanatory
  • Suspicious body language detection
    •     There is some reason to believe that body language can be indicative of unusual behaviour. Being able to detect this may lead to effective tracking of suspicious individuals before they are capable of executing an attack
  •  Suspicious dress behaviour
    •  The attackers in Paris dressed in dark clothing and attacked at night. This could prove challenging, however in combination with body language detection a useful detector could be produced.

Goal one:
AK-47 detection in a still image - this will hopefully lend itself to progress in a real-time video detection scheme. More specifically, this should be a gun currently being carried by somebody rather than just in some luggage. This may be extended to potential containers for an AK-47 as they must be transported somehow.

Literature dump: 
http://www.sciencedirect.com/science/article/pii/S1877050915014076

http://ieeexplore.ieee.org/xpl/login.jsp?tp=&arnumber=7253863&url=http%3A%2F%2Fieeexplore.ieee.org%2Fiel7%2F7227935%2F7253613%2F07253863.pdf%3Farnumber%3D7253863
http://cvgl.stanford.edu/teaching/cs231a_winter1415/prev/projects/CS231AGun.pdf

http://airccse.org/journal/ijcseit/papers/2212ijcseit16.pdf

http://staffnet.kingston.ac.uk/~ku33185/MEDUSA.html
... + more but lazy.

Edit: The MEDUSA project looks like a promising source of information, although appears like it may have been underfunded.

Youtube has a large collection of videos involving potential attackers and mock attacks which may contain highly useful training data for supervised learning based detectors.

Labelling data may prove difficult. I will have to evaluate whether it is worth doing it myself, generating the data (3D images can be effectively be used for object recognition in combination with domain adaptation techniques).

I would ultimately like to come up with some affordable way to disable firearms within a room - although my initial thoughts on this remind me of a children's TV show where the contestants would be covered in some kind of gunk - thinking about the way custard works - perhaps a more hardy non-newtonian fluid could be used to jam a rifle? 

Should I be successful in any of these topics, they shall of course be free and open to all so that hopefully these systems can be implemented to help prevent terrorist attacks in major cities and for those who are otherwise interested in learning about computer vision applications. A hefty research grant of course would not go amiss. 

Thursday 3 September 2015

Google Docs voice recognition (as written with it)


 So this is kind of my first go with Google Docs  voice recognition system and thought I'll give it a try because I've been reading about it a lot [articularly on Facebook. So I thought it would be a good opportunity to write a probably reasonably low quality blog post. Let's talk a little bit about how voice recognition has been used in the past. so most recently with Google we would probably think of the okay Google search feature that has been included in Android phones since  about version 4. Now as I type this I notice that I am having to go back and correct thae reasonable amount of what I've been talking about  I also find myself speaking more slowly and clearly than I normally would in order to give the speech recognition a   reasonable chance. however in general the accuracy does seem to be reasonably high especially given that I think I have quite a blocked nose at the moment which simply cannot be helping the the accuracy of the recognition or least use of the recognition. Since I have to end my sentences manually using a key word which I am not allowed to use  at the moment it does break up the flow of the diction a little bit.

 it's also pisses the way by Walt and fax using the wrong microphone. I'm sorry.  Apparently my microphone was somewhat too quiet and Google was struggling with it a little bit, not that I can blame them. Now that I have adjusted my volume setting it seems to be picking up things much more readily and is a little more responsive in general. So what can I say about this it seems that all you have to do is some fairly common sense configuration but in the end it actually seems to be doing a fairly remarkable job, so remarkable in fact that I'm not going to stop talking simply because it's quite interesting to watch.  Woohoo. in fact that is not what I just said but I actually attempted to use my falsetto to sing to the voice recognition system and apparently it picked that up as a woohoo which I'm going to take to mean that that it was good because  woohoo.

In general what seems to be a fairly solid voice recognition system although there are some keywords which you can't seem to get around not being able to say and I don't know how you work around that. my recommendation would be that you just try it see how you find it see if it works  well with your setup and you know happy Google doc’ing.

Saturday 29 August 2015

fw2.xyz - a descriptive url service

Let me introduce you to my most newly released little experiment, fw2.xyz 

Forward2Xyz is a service which allows you to build a url, for instance, such as fw2.xyz/the.megas.history.repeating.youtube.full.album (which I choose primarily because that band has been my most recent choice of work music) and have it magically direct you to the appropriate page. In many instances, it also successfully gets preview generation from sites such as Facebook.

Let's talk a little bit about the motivation for this - "why would I want this?" is always a good question to ask yourself. The scenario I have in my head is that a user wants to be able to share something that is reasonably commonly known (hence appears on google - which the site relies on) but cannot remember the exact URL.  Normally this would involve the user going on to find the URL using google, then copying and pasting that into whatever message box they were going to use.

With Foward2Xyz you simply type in some description of what you would like to type in directly into the URL (it will accept spaces, but most social media sites won't recognise the whole thing as a single link so periods or plus signs are recommended - periods are probably easier for most users as they don't require use of the shift key)

So what are the advantages, for a user, of something like this?

The URL is descriptive - it would be quite hard to Rick Roll somebody using a URL like this, for instance, unless you were seriously committed to SEO. Youtube on the other hand obscures the title of the video in their URLs opting for some non-human-readable key fw2.xyz/never.gonna.give.you.up

 It's very easy to type into a text input box and most social media sites will use it appropriately meaning these kinds of links are easy to share.

It's resistant to typos - this is the advantage of using Google's search for the back-end.

The resulting URL is sometimes even shorter than the actual URL of the page - although this definitely depends on how specific you need to be to get the right page.

But as with all things of this nature there are some disadvantages such as:

Non-persistence of URLs - these links are not necessarily reliable as they rely on Google search results. I think this caveat is not necessarily a huge problem as the use case is supposed to be for people sharing things on social media or IM meaning that the lifetime of the link is limited anyway.

You might not get the page you expected.

People may not trust the service (but you should definitely trust me. I'm from the Internet after all!)

Saturday 11 April 2015

Top 5 Your Game Jokes

So there was a conversation going on between people on #gamedev on twitter with the most amazing type of joke - jokes insulting your game! These are Your Game Jokes. So without further delay here are my top 5 your game jokes.

5. Your game has such little gameplay, they started calling the YouTube videos "Let's Reads"


From @keadin

4. Your game's so bad, not even Anti-Virus programs thinks it's legitimate software.



3. Your game's so bad, you'd even make ET the Atari game wanna leave this plannet!



2. Your game's so bad it killed gravity!



1. Your game's so unbalanced, it needs orthopedic shoes just to avoid falling over.

From @keadin

Saturday 4 April 2015

436Tap - addicting game released!

Test your concentration with 436Tap, a free casual Android game developed by yours truly from here!

This is of course a google play games free download! :)

https://play.google.com/store/apps/details?id=com.perceptrobyte.match436.game.android

Can you beat my high score?
Here's to this and hopefully more maths games or otherwise addictive mobile things!

I look forward to your feedback!

Just crushed the last couple of issues...

Just crushed the last couple of issues that were keeping me from releasing 436Tap!! - a resource leak and have made a couple of tweaks to the difficulty level. So I will be uploading the current build to the Play store! See you when it's fully published!

Wednesday 1 April 2015

Tumblr

You can now find all game development related posts mirrored on my new Tumblr account! Check it out here: http://perceptrobyte.tumblr.com

Into the land of mobile development

It has been a recent dream of mine to run away and build a startup - my first tentative step into this is to start building small Android mobile games in the hopes of getting my foot some way into the door of casual gaming. My first real attempt at this is a fairly simple reaction memory game for which I've made a fair amount of progress over the last few days - in the practical sense it is currently functional, however it has a couple of bugs to work out in both the technical sense and the interactive sense.

However I now have a list of features that I can add which should make the game a much more enjoyable experience. These include tweaking the difficulty curve and making sure the user's hand does not obstruct the screen - so for this I'm lucky to have some friends who are willing test subjects. The moral of the story is live, naive user testing is a good idea. Naturally adding the most evil features, social media sharing and ads, took a disproportionate amount of time to get right.

Having looked at the numbers, it seems like getting hold of a low cost iPhone development platform might be a good move. iPhone 3GS's seem to be going for less than £40 on eBay right now.

Anyway, for now here's a screenshot of what you see when you get a game over in the app as it currently stands:

My current highest score :D

The banner at the top was an interesting idea (this also appears at the start screen) - I wondered how I could best get across the gameplay concept simply and decided that indicating that you had to look for the middle value and a sequence of 4,3,6 followed by a tap from the user could be illustrated as it is to the left. However, from what I found, this does not translate well to intuition for the user of the game. As such I will be adding some explicit instructions.

You may also note at the bottom right the new logo (don't steal, it is my eye-P ;)) and identity for my one man shop named after this blog.

I've been using LibGDX for this project - so far it has shown a great amount of promise and a good tradeoff between flexibility and quirks, given it can target most platforms a casual games maker would be interested in. In particular I like its abstractions for hardware accelerated graphics - although I'm finding the UI system somewhat cumbersome. (particularly in terms of skinning - some things are available in code which are not available in JSON, or at least aren't easy to find documentation for); however that does its job well, too. I would definitely recommend for rapid development work when you want to target multiple platforms.

It is surprising how much work can go into designing a relatively simple game if the concept is novel (as far as the designer knows ;)). Hopefully after the next iteration of features it will be ready enough ship and that's what I'll be posting about - and if I don't, I guess I can always just say "April Fools!"

Monday 9 February 2015

In continuation of my last post...

Here's something interesting.

http://www.immortal.org/5211/new-34-smartphone-device-tests-hiv-syphilis-15-minutes/

A smartphone device which can perform tests on you to determine whether you have syphilis or HIV in a convenient and compact form factor. While this kind of technology no doubt has a legitimate premise and obvious usefulness, given the sort of dealings some tech companies seem to have in ethically questionable research, potentially giving them access to this kind of information could be a little unsettling.

(the aforementioned post)