A journey to Elixir and YOLO

IT Pornography
3 min readJan 31, 2022

Some time ago I was looking for something new to learn and to use for creating cool projects with. Since I watched for the first time Star Trek, my secret dream had always been creating a Teleport… I spent many years at University studying Engineering and Computer Science and I learned nothing about it. What a waste!

Well, the time wasn’t ready for this technology and I had to reduce my expectations. So, I came to buy a Jetson Nano. After all, if I cannot create a Teleport maybe I can dream about just a rather very intelligent system…

One of the most interesting project I found for this device was an OpenVINO demo which was performing inferences on YOLO models using just the CPU. It was using an OpenVINO IR model obtained translating the original Darknet YOLO configurations and weights into ONNX models and then transformed into an OpenVINO IR model. I liked its quite good performances in doing inferences using only the CPU, even on a low-end (yes, I’m a gentleman) Nano platform.

But somehow my spare time between work and the rest of my life ended up so I put those studies in a corner, waiting for better times to come.

Now time passed by, and it is not getting better… So I pushed something here and there, and I back to work on my Nano. I cannot learn and remember anything if it is not matter of life or death (like my wife’s birthday) or if I am not working to something interesting to me. No chances for a TODO list or a static demo site with 4 standard functions. I need something complex to work on.

And one of the most complex things I know is Erlang. In another life I maintained a little part of Ejabberd project, but I haven’t written a line of erl code in the last 15 years. I almost forgot everything about it. On the other hand, I heard about the Elixir language and I think it is a cool idea because it is reducing the learning curve of Erlang while maintaining its main features (like Actors paradigm). So, why not giving it a try?

Thanks to Loreto Parisi I found the quite interesting Nx project so I started working on a YOLO demo which is replicating the OpenVINO example I found some months ago while playing with the Nano.

Since the Nx project is including an AxonOnnx library which is importing an ONNX model to Axon, I realized the whole path to my Elixir learning:

  1. Create something which will translate YOLO Darknet weights and config files to ONNX models
  2. Import the generated ONNX model into Nx/Axon
  3. Perform inferences using Axon

In other words obtain from this:

Something like this:

The path to obtain this object recognition from a YOLO model has been full of questions, thinking, rethinking, errors and refactoring but I finally managed to reach my goals. So now I know a few about Elixir, a little about Nx (and many other projects) and nothing about object detection. Cool!

As some of you may understand, my journey is not finished but I like to share some thoughts on it. In next post I’ll share my experience in achieving the task #1.

I know, you can’t wait… See you next time.

--

--

IT Pornography

Are you here because of “pornography”? Well… Here I just undress IT.