Thursday, June 6, 2019

Playing with Mapbox

I was playing around with mapbox in Unity 2019.1.5f1 and it gave me an error, after some googling i figured out a simple solution. I'm not messing around with AR, so i deleted these folders and then the project compiled. I figured this is good too because its a bunch of AR assets that I wouldn't be using anyway:

  • GoogleARCore
  • MapboxAR
  • UnityARInterface
  • UnityARKitPlugin
Another interesting note, is I tried to load mapbox into a premade scene with HDRP settings and something with the shaders was messed up. My globe came in purple, at least when i did a blank scene it rendered correctly. I didn't feel like trying to fix it, but long term might be worth the effort to get the juicy visual quality that unity can provide. 

After poking around with the tutorial I was able to get some decent looking results. I'm pleased with this result with such little effort! Not to be picky, but I noticed some of the buildings weren't identified, I presume this is loaded from some ML defined satellite database analyzed by google or mapbox with some building classifier... Interesting!  Probably good for prototyping but this wouldn't be contextually perfect. Also, the resolution does do pretty well wherever you zoom in, but its a little worse than google in terms of resolution. 

That said, scaling up the extents and zoom really provides amazing results! What a powerful tool!



Creating Jetson OS Backup

Googling around, because I wanted to create a flashable iso image of my jetson nano before I do things that potentially break the OS... This would give me a rapid recoverable way to restore my Jetson Nano instead of the 30-60 min process it takes to re-flash, reconfigure, and reinstall all the basic software tools I want to use. Flashing a premade image takes like 5 minutes-ish.

It looks easier than I expected! It looks like I don't have to install anything to create the image or flash this on linux:

https://thepihut.com/blogs/raspberry-pi-tutorials/17789160-backing-up-and-restoring-your-raspberry-pis-sd-card

Tuesday, June 4, 2019

Posting a new repo to github

Jotting some quick notes on how to properly push up local files and get it synced with github.com because I'm starting to do it fairly frequently and it takes me some time...

1. Adding an existing project to github using the command-line
2. When the upload fails it says,"
git push origin masterWarning: Permanently added the RSA host key for IP address '192.30.X.X' to the list of known hosts.Permission denied (publickey).fatal: Could not read from remote repository.
Please make sure you have the correct access rightsand the repository exists."

3. generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
4. adding-a-new-ssh-key-to-your-github-account
5. I messed up by creating a readme, and so now it gave me this error:
$ git push origin masterTo git@github.com:nickswimsfast/SpatialPerception.git ! [rejected]        master -> master (fetch first)error: failed to push some refs to 'git@github.com:nickswimsfast/SpatialPerception.git'hint: Updates were rejected because the remote contains work that you dohint: not have locally. This is usually caused by another repository pushinghint: to the same ref. You may want to first integrate the remote changeshint: (e.g., 'git pull ...') before pushing again.hint: See the 'Note about fast-forwards' in 'git push --help' for details.

The solution (but rough and risky solution) was to:
git push origin master --force


Monday, June 3, 2019

ML Dive

Diving into some ML... While I have cloned repo's and applied them successfully with transfer learning with models like inceptionv3, and resnet, I wanted to get in a little deeper. Before I could get started, I set out to setup my VR computer (GTX 1070 Graphics) as a development box. This entailed getting dual boot windows/ubuntu setup along with VNC.

Tensorflow Setup
I was surprised because just getting my computer properly setup to use GPU accelerated machine learning was more of a chore then I expected. It took me a solid 3 hours to decipher all the things I had to do in order to get actually training neural nets on the GPU. I'm confident it was worth it for speed, but geez!!! It shouldn't be this hard! Docker, Cuda 10 drivers, linking to the OS so I could save files permanently, etc... Anyway, I documented the entire arduous process on github - a little messy because they were quick notes for myself, but it might help somebody:

[SetupML Github repository]

VNC = dev speed
Can I just mention the ability to log into my VR computer from anywhere in the house is a godsend! I can sit with my laptop and work on it from the couch, from the bed, from my desktop computer or laptop! So much more productive.

Getting started with ML
Once I was setup I verified things were working with these quick tutorials:

* [Basic Classification]
* [Text Classification]


Synthetic Data
Enough with the tutorials! I wanted to branch out on my own more or less scratch built perception model, so I crafted up some semi-automatic 200 synthetic images with truth labels in Unity and set out to work. I spent pretty much this whole weekend putting all this together getting data formatting right, arrays setup with the right datatypes, so I can have an automatically setup training and test data sets.


Complex Model
Unfortunately, I'm trying to get my last layer to be a multi-dimensional regressive output, this is proving to be more challenging than I thought. The few times i successfully trained my rough models, I was getting at best 60% accuracy. I've got to spend a few more days researching keras model architecture, I think its bad. Been messing around with the sigmoid, linear, and softmax activation functions, along with various loss functions. I stumbled onto these interesting links which might help me find the answer:
* [Keras Github Examples]
* [Keras Documentation - with examples]

Whew! Time for sleep!

First Github Repo!

I've made several github repositories on at work on our local network's git website, but I had never posted my own repo outside that ecosystem. Today is my first public repo on github! I made some scripts to make it easier to change the clockrate/power consumption of the jetson nano instead of having to remember all the commands and syntax. Here it is:

Jetson Power Scripts
[Jetson Nano power management](https://github.com/nickswimsfast/jetson_powermgmt)

Good instructions for starting a [new github repo](https://kbroman.org/github_tutorial/pages/init.html).

SSH/VNC to Jetson Nano
I setup ssh beforehand with vino on the jetson itself - the default instructions weren't exactly right, but some googling later and you'll git it!. Also, I've found that using realvnc works great for connecting to it (free solution). TightVNC costs money?! Also, on my x86 windows desktop computer it was easy to use ubuntu's built-in remote desktop sharing. I also had to install openssh-server on the x86 computer, but I don't think i needed to do that on the Jetson, i think it came with that by default.