Skip to content

Instantly share code, notes, and snippets.

View ThejanW's full-sized avatar
🎯
Focusing

Thejan Wijesinghe ThejanW

🎯
Focusing
View GitHub Profile
@ThejanW
ThejanW / install_blender_pyenv.md
Created March 20, 2020 12:56 — forked from keunhong/install_blender_pyenv.md
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
ThejanW / pipeline.py
Created February 28, 2020 16:25 — forked from alexmacedo/pipeline.py
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
ThejanW / classifier.py
Last active April 18, 2018 10:17
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
tensorflow
keras
Usage: python3 classifier.py #n_epochs
@ThejanW
ThejanW / gist:41d3ec5e846c80f06b69ebfd533b72b3
Created July 15, 2017 16:25 — forked from jwebcat/gist:5122366
Properly download from github using wget and curl
wget --no-check-certificate --content-disposition https://github.com/joyent/node/tarball/v0.7.1
# --no-check-cerftificate was necessary for me to have wget not puke about https
curl -LJO https://github.com/joyent/node/tarball/v0.7.1
# 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
ThejanW / gist:af6e5d9447ef707c32874cc6bcee32dd
Created December 1, 2016 15:41 — forked from jpanganiban/gist:3844261
Pygame + OpenCV Real-time Face Detection
#!/usr/bin/env python
from pygame import camera
import pygame
import time
import cv
import os
# Recognition
@ThejanW
ThejanW / camerastream.py
Created December 1, 2016 15:39 — forked from snim2/camerastream.py
Display the output of a webcam using Python and Pygame
import pygame
import pygame.camera
from pygame.locals import *
DEVICE = '/dev/video0'
SIZE = (640, 480)
FILENAME = 'capture.png'
def camstream():
pygame.init()
@ThejanW
ThejanW / qt4-webcam.py
Created November 26, 2016 16:40 — forked from TimSC/qt4-webcam.py
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.