Skip to content

Instantly share code, notes, and snippets.

berak / depth_from_single_img.txt
Last active Sep 10, 2020
depth from single image / www
View depth_from_single_img.txt
code running
run to download the pretrained 'unet.onnx' is a webserver, receiving images of indoor scenes and sending back depth images.
up.html is the main webpage
View flow.prototxt
input: "img0"
input: "img1"
input_shape {
dim: 1
dim: 3
dim: 720
dim: 1280
input_shape {
dim: 1
berak / mulim.cpp
Created Dec 27, 2019
dnn multiple images
View mulim.cpp
#include <iostream>
#include <opencv2/opencv.hpp>
using namespace cv;
using namespace std;
using namespace cv;
using namespace std;
int main(int argc, char** argv) {
string folder = "c:/data/dnn/tcnn/";
berak / mace.cpp
Last active Dec 26, 2019
mace test
View mace.cpp
// images from
int main(int argc, char **argv) {
Ptr<MACE> mace = MACE::create();
vector<string> fn;
for (int i=0; i<fn.size(); i++) {
vector<Mat> train_img;
berak / pyopencv_generated_funcs.h
Created Dec 4, 2019
View pyopencv_generated_funcs.h
static PyObject* pyopencv_cv_solvePnPGeneric(PyObject* , PyObject* args, PyObject* kw)
using namespace cv;
PyObject* pyobj_objectPoints = NULL;
Mat objectPoints;
PyObject* pyobj_imagePoints = NULL;
Mat imagePoints;
PyObject* pyobj_cameraMatrix = NULL;
berak / div.cpp
Created Oct 21, 2019
cv::Mat divide problem
View div.cpp
Mat m1(3,3,CV_32FC3,Scalar(3,2,1));
Mat m2;
cout << m1 << endl << m2 << endl;
Mat n = m1/m2;
cout << n << endl;
cout << n << endl;
berak / ar.cpp
Created Oct 5, 2019
resnet-34_kinetics action recognition
View ar.cpp
#include <fstream>
#include <iostream>
#include <sstream>
#include <opencv2/dnn.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
using namespace cv;
berak /
Last active Aug 20, 2019
torch dnn batchnorm
# colab - install latest
# !pip install opencv-python==
import torch
import torch.nn as nn
import torchvision
import numpy as np
import cv2
berak /
Created Mar 30, 2019
python landmarks test script
# this is a travis related oddity, ignore ...
import sys
import cv2, numpy as np
img = cv2.imread("david2.jpg",0)
cas = cv2.CascadeClassifier("haarcascade_frontalface_alt2.xml")
faces = cas.detectMultiScale(img, 1.5, 5)
View fbox.cpp
#include <opencv2/dnn.hpp>
#include <opencv2/opencv.hpp>
using namespace cv;
using namespace cv::dnn;
using namespace std;
int main(int argc, char **argv)
String modelTxt = "c:/data/mdl/faceboxes/deploy.prototxt";
You can’t perform that action at this time.