Skip to content

Instantly share code, notes, and snippets.

View qingswu's full-sized avatar

qingswu

  • Canada
View GitHub Profile
@vertix
vertix / tf_data_augmentation_on_gpu.py
Last active April 9, 2022 20:55
TF data augmentation on GPU
def augment(images, labels,
resize=None, # (width, height) tuple or None
horizontal_flip=False,
vertical_flip=False,
rotate=0, # Maximum rotation angle in degrees
crop_probability=0, # How often we do crops
crop_min_percent=0.6, # Minimum linear dimension of a crop
crop_max_percent=1., # Maximum linear dimension of a crop
mixup=0): # Mixup coeffecient, see https://arxiv.org/abs/1710.09412.pdf
if resize is not None:
@0xjac
0xjac / private_fork.md
Last active July 6, 2024 15:09
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

@fperez
fperez / SimpleNeuralNets.ipynb
Last active April 19, 2022 18:52
Notes for "Why does deep and cheap learning work so well?" (ArXiv:1608.08225v1/cond-mat.dis-nn) by Lin and Tegmark.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@SteveRuben
SteveRuben / client.cpp
Created October 21, 2015 08:30
Multiple streaming in c++ using opencv; OpenCV video streaming over TCP/IP
/**
* OpenCV video streaming over TCP/IP
* Client: Receives video from server and display it
* by Steve Tuenkam
*/
#include "opencv2/opencv.hpp"
#include <sys/socket.h>
#include <arpa/inet.h>
#include <unistd.h>
@BloodAxe
BloodAxe / eggs_detector.cpp
Created July 15, 2014 14:37
Image enchancement and Hough transform example
/**
* @brief Image enchancement and Hough transform example
* @author Eugene Khvedchenya <ekhvedchenya@gmail.com>
* @copyright computer-vision-talks.com/articles/how-to-detect-circles-in-noisy-image/
*/
#include <opencv2/opencv.hpp>
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active July 6, 2024 20:09
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@Yago
Yago / free-tiles.txt
Created January 29, 2014 11:01
GIS - Free tiles
Nokia :
http://{s}.maptile.maps.svc.ovi.com/maptiler/v2/maptile/newest/normal.day/{z}/{x}/{y}/256/png8
MapQuest :
http://a.tile.openstreetmap.org/{z}/{x}/{y}.jpg
http://otile1.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg
http://otile1.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.jpg
@wh5a
wh5a / mp6.c
Last active April 5, 2024 08:02
CUDA 2D Convolution.
#include <wb.h>
// Check ec2-174-129-21-232.compute-1.amazonaws.com:8080/mp/6 for more information
#define wbCheck(stmt) do { \
cudaError_t err = stmt; \
if (err != cudaSuccess) { \
wbLog(ERROR, "Failed to run stmt ", #stmt); \
return -1; \
@moolex
moolex / ip.set.bat
Created January 4, 2013 05:04
Windows下自动设置IP的批处理脚本
@echo off
::需要设置的网络,一般为“本地连接”或者“无线网络连接”
set name="无线网络连接"
::请根据您的参数修改以下数据
::设置 IP地址
set ipaddress=18.1.16.169
::设置 子掩码
set mask=255.255.252.0
::设置 网关
set gateway=18.1.19.254
@mshivers
mshivers / nnlr
Created February 3, 2012 15:46
L2 Regularized Non-negative logistic regression
import scipy as sp
from scipy import optimize as opt
def nnlr(X, y, C):
"""
Non-negative Logistic Regression with L2 regularizer
"""
def lr_cost(X, y, theta, C):
m = len(y)
return (1./m) * (sp.dot(-y, sp.log(sigmoid(sp.dot(X, theta)))) \