This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def left_right_crop(img, size): | |
if isinstance(size, numbers.Number): | |
size = (int(size), int(size)) | |
else: | |
assert len(size) == 2, "Please provide only two dimensions (h, w) for size." | |
w, h = img.size | |
crop_h, crop_w = size | |
if crop_w > w or crop_h > h: | |
raise ValueError("Requested crop size {} is bigger than input size {}".format(size, (h, w))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# EDIT: this script is outdated, please see https://forums.developer.nvidia.com/t/pytorch-for-jetson-nano-version-1-6-0-now-available | |
# | |
sudo apt-get install python-pip | |
# upgrade pip | |
pip install -U pip | |
pip --version | |
# pip 9.0.1 from /home/ubuntu/.local/lib/python2.7/site-packages (python 2.7) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1D POC --------------------------------------------------------------------------------------- | |
cv::Point2d phaseCorrelate1D(InputArray _src1, InputArray _src2, InputArray _window, int k=65535, int flag_pixel = false) | |
{ | |
Mat src1 = _src1.getMat(); | |
Mat src2 = _src2.getMat(); | |
Mat window = _window.getMat(); | |
CV_Assert( src1.type() == src2.type()); | |
CV_Assert( src1.type() == CV_32FC1 || src1.type() == CV_64FC1 ); | |
CV_Assert( src1.size == src2.size); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import numpy as np | |
import os | |
import cv2 | |
import pandas as pd | |
from sklearn.cross_validation import train_test_split | |
from keras.models import Sequential | |
from keras.layers.core import Dense, Dropout, Activation, Flatten | |
from keras.layers.convolutional import Convolution2D |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Install Python prerequisites on NVIDIA Jetson TK1 for iTorch | |
# This is for https://github.com/facebook/iTorch | |
# L4T 21.3, Torch 7 (http://torch.ch) | |
# Python 2.7 or greater must be installed before running this script | |
# Torch 7 should already be installed before running this script | |
# iPython is loaded using pip, as repository version is 1.x version, > 2.0 is needed | |
# Need to compile from source as repository version libzmq3-dev is not the correct revision | |
wget http://download.zeromq.org/zeromq-4.0.5.tar.gz | |
tar xzvf zeromq-4.0.5.tar.gz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "opencv2/opencv.hpp" | |
#include <omp.h> | |
using namespace cv; | |
#if _DEBUG | |
#pragma comment(lib, "opencv_core248d.lib") | |
#pragma comment(lib, "opencv_highgui248d.lib") | |
#pragma comment(lib, "opencv_imgproc248d.lib") | |
#pragma comment(lib, "opencv_contrib248d.lib") | |
#else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
# -*- coding: utf-8 | |
import sys | |
import numpy | |
from numpy import pi, sin, cos | |
from scipy.optimize import leastsq | |
import scipy, scipy.fftpack | |
import cv2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>sublime text tip</title> | |
</head> | |
<body> | |
<h3>Less.sublime-build</h3> | |
<code> | |
{ |