Skip to content

Instantly share code, notes, and snippets.

@shrubb
shrubb / dqn_submit.cpp
Created July 24, 2015 03:43
DQN helper
#include <cmath>
#include <iostream>
#include <ale_interface.hpp>
#include <glog/logging.h>
#include <gflags/gflags.h>
#include "prettyprint.hpp"
#include "dqn.hpp"
#include <fstream>
#include <string>
@shrubb
shrubb / olymp_template.cpp
Last active August 29, 2015 14:27
Competitive programming template
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <cstring>
#include <cmath>
@shrubb
shrubb / evaluator.cpp
Created August 16, 2015 14:53
Arithmetic expression evaluator
//
// Created by shrubb on 16.08.15.
//
#include <string>
#include <iostream>
#include <algorithm>
const std::string validOps = "+-*/";
@shrubb
shrubb / sorts.cpp
Last active August 29, 2015 14:27
Sorting algorithms
//
// Created by shrubb on 16.08.15.
//
#include <iostream>
#include <algorithm>
void radixSort(int *arr, size_t size) {
for (size_t i = 0; i < size; ++i) {
arr[i] ^= (1 << 31);
#include <iostream>
#include <vector>
#include <limits.h>
int main(int, char**)
{
int n;
std::cin >> n;
std::vector<long long> count(10001);
long long minimum = INT_MAX;
// compile with: /D_UNICODE /DUNICODE /DWIN32 /D_WINDOWS /c
#include <windows.h>
#include <psapi.h>
#include <stdlib.h>
#include <string.h>
#include <tchar.h>
#include <stdio.h>
#include <limits.h>
#include <iostream>
@shrubb
shrubb / torch-opencv-blogpost.md
Last active January 11, 2018 00:46
"OpenCV bindings" post for Torch blog

OpenCV Bindings for Torch

The OpenCV library implements tons of useful image processing and computer vision algorithms, as well as the high-level GUI API. Written in C++, it has bindings in Python, Java, MATLAB/Octave, C#, Perl and Ruby. We present the Lua bindings that are based on Torch.

By combining OpenCV with Torch's scientific computation abilities, one gets an even more powerful framework capable of handling computer vision routines (e.g. face detection), interfacing video streams (including cameras), easier data visualization, GUI interaction and many more. In addition, most of the computationally intensive algorithms are available on GPU via Cutorch. All these features may be essentially useful for those dealing with deep learning applied to images.

Usage Examples

@shrubb
shrubb / torch-opencv-blogpost.md
Last active June 1, 2016 08:53 — forked from szagoruyko/torch-opencv-blogpost.md
"OpenCV bindings" post for Torch blog

OpenCV Bindings for Torch

The OpenCV library implements tons of useful image processing and computer vision algorithms, as well as the high-level GUI API. Written in C++, it has bindings in Python, Java, MATLAB/Octave, C#, Perl and Ruby. We present the Lua bindings that are based on Torch, made by VisionLabs with support from Facebook and Google Deepmind.

By combining OpenCV with scientific computation abilities of Torch, one gets an even more powerful framework capable of handling computer vision routines (e.g. face detection), interfacing video streams (including cameras), easier data visualization, GUI interaction and many more. In addition, most of the computationally intensive algorithms are available on GPU via Cutorch. All these features may be essentially useful for those dealing with deep learning applied to images.

Usage Examples

Interactive Face Recognition with GPU

To provide an example of how OpenCV's CUDA module can be used in Torch, we have implemented interactive face recognition in this application.

Important warning

In this very example, the recognition quality may be rather poor as, in fact, the OpenFace's face recognition framework is intended to work in a more complicated way. Here, we didn't locate facial landmarks and estimate head pose, although this is an essential part of the pipeline. Keep this in mind when working with this task, and consult OpenFace's website for further information.

How to use it

@shrubb
shrubb / nla-lectures.ipynb
Created December 8, 2016 14:24
NLA lectures
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.