Here is an overview of some of the open source projects that I worked on during the past years.
Tensorflow.js ONNX Runner
After successfully running pre-trained Caffe models in the browser without any modifications, I thought about a more general approach of porting pre-trained models to the web. Hence, I decided to look into the ONNX (Open Neural Net Exchange Format) specification. ONNX is a format aimed for interchanging pre-trained models between different runtimes and looks perfect for my use-case.
The Tensorflow.js ONNX Runner is a proof of concept implementation for running arbitrary ONNX models in the browser using Tensorflow.js. This means that we could run any model from any framework supporting ONNX (PyTorch, Caffe2, CNTK, Tensorflow, Core ML etc.) in the browser without modification.
The code is as simple as loading the ONNX model from a path and using it as a Tensorflow model - as shown in the following example:
var modelUrl = 'models/squeezenet/model.onnx'; // Initialize the tf.model var model = new onnx.loadModel(modelUrl); // Now use tf.model const pixels = tf.fromPixels(img); const predictions = model.predict(pixels);
For production use-cases, a better approach would be to convert the ONNX model to a tfjs model using the Tensorflow.js converter module. This also allows the developers to optimize the model for the usage in the browser.
CaffeJS - Running Caffe models in the browser
CaffeJS started as a proof of concept for porting Caffe models to the browser using a modified version of ConvNetJS (by Andrej Karpathy). At first, I only wanted to parse Caffe architectures from
*.prototxt in order to visualize and analyze the flow of activations through the network.
getUserMedia API (to access the webcam in the browser) on a Desktop and mobile phone.
n3-line-charts - Awesome charts for Angular
2013 was the year of custom chart libraries, basically everyone (including me) was building custom charting solutions based on RaphaelJS, plain SVG, D3.js or Canvas. Back then I realized that I don’t want to put more effort into rebuilding existing functionality but rather contribute to an existing project. Therefore I looked around for the best charting library (for my needs) and got involved submitting PRs, fixing Issues and writing examples. This was the awesome library n3-line-chart. I also realized, that it was tightly coupled to AngularJS which made it impossible to reuse it in different JS frameworks or simply VanillaJS. After some hangout discussions with the author Sébastien Fragnaud we quickly decided to rewrite the whole library in TypeScript and decouple it from AngularJS. On top we introduced a modular event-based architecture allowing to extend the functionality of the library easily.
And here it is today, an awesome, clean and extensible charting library.
You can take a look at the charts on our examples page.
python-fs - A pythonic filesystem wrapper for humans
When dealing with typical filesystem operations in Python, I quickly found myself rewriting a lot of similar functionalities again and again for every project, such as finding files in folders, dumping objects to disk, dealing with prefixes etc. On top I found it very hard to remember which functionalities can be found in which std libs, such as
shutil, etc. Hence I decided to write a small library to wrap all filesystem operations in one place with a
bash like API - this is what became
python-fs in the end.
Installing is straight forward using pip.
pip install pyfs
Here is a simple example of using
python-fs to delete all
*.pyc files in the
import fs fs.rm( fs.find('*.pyc', path='src') )
You can find extensive documentation and many examples on th Github page of the project.