Skip to content

Instantly share code, notes, and snippets.


Eugene Khvedchenya BloodAxe

View GitHub Profile
BloodAxe / Dual-head model with
Created Jan 18, 2020
This gist shows to how define dual-head model for predicting mask & global-level image class
View Dual-head model with
from pytorch_toolbelt.modules import ABN, GlobalAvgPool2d
from pytorch_toolbelt.modules import decoders as D
from pytorch_toolbelt.modules import encoders as E
from torch import nn
from torch.nn import functional as F
class FPNCatSegmentationModel(nn.Module):
def __init__(
View mosaic.cpp
* OpenCV Rocks - Image mosaic demo
* This tutorial shows how to create mosaic image
* from digital photography using OpenCV.
* Author: Eugene Khvedchenya <>
* More information:
* -
BloodAxe / Eigen2CV.h
Created Aug 16, 2014
This header file contains code snippet for easy mapping Eigen types to OpenCV and back with minimal overhead.
View Eigen2CV.h
* @brief Mapping functions from Eigen data types to OpenCV
* @author Eugene Khvedchenya <>
* @details This header file contains code snippet for easy mapping Eigen types to OpenCV and back with minimal overhead.
* @more
* Features:
* - Mapping plain data types with no overhead (read/write access)
* - Mapping expressions via evaluation (read only acess)
* Known issues:
BloodAxe / eggs_detector.cpp
Created Jul 15, 2014
Image enchancement and Hough transform example
View eggs_detector.cpp
* @brief Image enchancement and Hough transform example
* @author Eugene Khvedchenya <>
* @copyright
#include <opencv2/opencv.hpp>
BloodAxe / gist:a8817980ec8412d16737
Last active Aug 29, 2015
Show a little love for IOS (configure toolchain)
View gist:a8817980ec8412d16737
# Show a little love for IOS (configure toolchain)
set(SDKVER "7.1")
set(DEVROOT "/Applications/")
set(SDKROOT "iphoneos7.1")
set(CMAKE_OSX_ARCHITECTURES "armv7 armv7s")
BloodAxe / histogram.cpp
Created Sep 29, 2013
Color image histogram in OpenCV
View histogram.cpp
void drawHistogram(cv::Mat src, cv::Mat& histImage)
using namespace cv;
using namespace std;
/// Separate the image in 3 places ( B, G and R )
vector<Mat> bgr_planes;
split( src, bgr_planes );
/// Establish the number of bins
BloodAxe /
Last active Jan 3, 2018
Configure DigitalOcean Droplet for cloud image processing
# Prepare system
apt-get update
apt-get upgrade
apt-get install build-essential
apt-get install cmake
apt-get install git
apt-get install pkg-config
# Grab frest opencv library
curl -sL >
View OpenCV bulid info
General configuration for OpenCV 2.9.0 =====================================
Version control: unknown
Host: Linux 2.6.32-358.14.1.el6.mmapsem.x86_64 x86_64
CMake generator: Unix Makefiles
CMake build tool: /usr/bin/gmake
Configuration: Release
BloodAxe /
Last active Dec 21, 2015
Checkout opencv and builds it for Node.js module
cd ~/
curl -L >
sh --prefix='~/lib/cmake'
curl -L 2> /dev/null >
BloodAxe / node-js-opencv-bare-min.cpp
Last active Dec 21, 2015
Minimal Node.js nodule that prints OpenCV build information
View node-js-opencv-bare-min.cpp
#include <node.h>
#include <opencv2/opencv.hpp>
#include <string>
using namespace v8;
// This function returns a JavaScript number that is either 0 or 1.
Handle<Value> buildInformation(const Arguments& args)
// At the top of every function that uses anything about v8, include a