Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Thejan Wijesinghe ThejanW

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

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 Feb 28, 2020 — forked from alexmacedo/pipeline.py
Unix pipeline pattern in python
View pipeline.py
#! /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 Apr 18, 2018
This script makes use of pre-trained Inception V3 network's weights to make your own image classifier
View classifier.py
#!/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 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 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
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
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
ThejanW / camerastream.py
Created Dec 1, 2016 — forked from snim2/camerastream.py
Display the output of a webcam using Python and Pygame
View camerastream.py
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 Nov 26, 2016 — 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.
View qt4-webcam.py
'''
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.