Skip to content

Instantly share code, notes, and snippets.


Thejan Wijesinghe ThejanW

View GitHub Profile
ThejanW /
Created Mar 20, 2020 — forked from keunhong/
Install blender as a module with python 3.5 and pyenv

Install blender as a module with python 3.7 and pyenv

Instructions WIP

Tested on Ubuntu 18.04.

Setting up a new python environment using pyenv

Follow instructions from here.

Installing boost

ThejanW /
Created Feb 28, 2020 — forked from alexmacedo/
Unix pipeline pattern in python
#! /usr/bin/env python
class Pipeline(object):
def __init__(self):
self.source = None
def __iter__(self):
return self.generator()
def generator(self):
ThejanW /
Last active Apr 18, 2018
This script makes use of pre-trained Inception V3 network's weights to make your own image classifier
#!/usr/bin/env python
This script makes use of pre-trained Inception V3 network's weights to make your own image classifier
Go through the script, make your own changes to the network as well as to the hyper-parameters
Dependencies: numpy
Usage: python3 #n_epochs
ThejanW / gist:41d3ec5e846c80f06b69ebfd533b72b3
Created Jul 15, 2017 — forked from jwebcat/gist:5122366
Properly download from github using wget and curl
View gist:41d3ec5e846c80f06b69ebfd533b72b3
wget --no-check-certificate --content-disposition
# --no-check-cerftificate was necessary for me to have wget not puke about https
curl -LJO
View InceptionRestVideoDocker
# Take base as Ubuntu: 16.04, then you can simply apt-get install ffmpeg
FROM ubuntu:16.04
# Install missing part of ubuntu core + python + building dependencies
RUN apt-get update && \
apt-get install -y wget git unzip curl \
libtcmalloc-minimal4 software-properties-common apt-utils \
build-essential cmake pkg-config \
libjpeg8-dev libtiff5-dev libjasper-dev libpng12-dev \
libavcodec-dev libavformat-dev libswscale-dev libv4l-dev \
libxvidcore-dev libx264-dev \
ThejanW / gist:af6e5d9447ef707c32874cc6bcee32dd
Created Dec 1, 2016 — forked from jpanganiban/gist:3844261
Pygame + OpenCV Real-time Face Detection
View gist:af6e5d9447ef707c32874cc6bcee32dd
#!/usr/bin/env python
from pygame import camera
import pygame
import time
import cv
import os
# Recognition
ThejanW /
Created Dec 1, 2016 — forked from snim2/
Display the output of a webcam using Python and Pygame
import pygame
from pygame.locals import *
DEVICE = '/dev/video0'
SIZE = (640, 480)
FILENAME = 'capture.png'
def camstream():
ThejanW /
Created Nov 26, 2016 — forked from TimSC/
QT4 Webcam demo in python. Copyright (c) 2013, Tim Sheerman-Chase.. May be used under BSD or CC0 license. Requires python bindings to opencv.
QT4 Webcam demo in python
Copyright (c) 2013, Tim Sheerman-Chase
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.