Skip to content

Instantly share code, notes, and snippets.

View bhautikj's full-sized avatar

Bhautik Joshi bhautikj

View GitHub Profile
@bhautikj
bhautikj / cropTestTwitter.py
Created September 20, 2020 23:19
Testing crop algorithm on twitter
#
# Written for python
# pip install tweepy pillow
#
import tweepy
from PIL import Image, ImageFilter
import glob, os, sys, time
SLEEPTIME = 3 #in seconds
@bhautikj
bhautikj / renderFullscreenQuadToPillowModernGL.py
Created April 21, 2019 05:28
Render a GLSL shader to a 'fullscreen', offscreen quad and show via a Pillow image buffer using ModernGL 5.5.0
#
# Bhautik Joshi bjoshi@gmail.com 2019
# render to fullscreen quad with modernGL
# passes vertex position via vert_pos from the vertex
# shader to the fragment_shader; is normalized to [0,1]
# with (0,0) in the bottom-left corner
#
import moderngl
import numpy as np
@bhautikj
bhautikj / getOtherEye.sh
Created June 25, 2018 21:40
Extract other eye from a VR180 photo from a Lenovo Mirage camera
#!/bin/sh
exiftool -config gimage.config -b -XMP-GImage:Data $1.jpg | base64 --decode > othereye.jpg
@bhautikj
bhautikj / fs_and_recovery.md
Last active June 20, 2018 00:16
Linux external drive: filesystem & filesystem recovery notes

External drives & linux

tl;dr

I've had some bad times with external drives & linux.

Don't use ext4 on external USB drives

Do use EXfat on external USB drives

If you have to use ext4 then consider using a loopback-backed-file on an EXfat volume

Style Transfer setup (pycaffe based approach)
==
1. Fetch, install CUDA: https://developer.nvidia.com/cuda-downloads
2. Install opencv:
brew install homebrew/science/opencv
3. edit opencv, reinstall
brew edit opencv
3.1 replace the following lines:
args << "-DPYTHON#{py_ver}_LIBRARY=#{py_lib}/libpython2.7.#{dylib}"
@bhautikj
bhautikj / a.jpg
Last active January 17, 2017 07:58
temporally median filter videos
a.jpg
@bhautikj
bhautikj / batcountry_nsfw.py
Created October 1, 2016 14:25
deep dreaming + open nsfw
# git clone https://github.com/jrosebr1/bat-country.git
# git clone https://github.com/yahoo/open_nsfw
# cd bat-country
from batcountry import BatCountry
import numpy as np
from PIL import Image
import caffe
import sys
@bhautikj
bhautikj / lapseSync.py
Created May 25, 2016 06:58
Tool to sync timelapse sequences across multiple cameras.
#
# lapseSync.py
# ------------
#
# author: Bhautik Joshi, 2016
# license: Apache 2.0 http://www.apache.org/licenses/LICENSE-2.0
#
# Tool to ingest timelapse sequences from multiple cameras and generate a list
# of images across the cameras to be synced to a single clock specified by a
# given interval. The images are synced to the earliest image in each directory.
@bhautikj
bhautikj / setup_neural_style_osx.sh
Created May 25, 2016 04:48
setup neural-style on osx
sudo easy_install pip
sudo easy_install --upgrade six
sudo pip install --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.8.0-py2-none-any.whl
brew install gcc
sudo pip install scipy pillow numpy
git clone https://github.com/anishathalye/neural-style
cd neural-style
curl http://www.vlfeat.org/matconvnet/models/beta16/imagenet-vgg-verydeep-19.mat > imagenet-vgg-verydeep-19.mat
@bhautikj
bhautikj / vrembed_how_weird.xml
Created February 20, 2016 08:55
vrembed example
<story>
<scene name="intro">
<photo src="https://c2.staticflickr.com/6/5688/23494440049_547ec58c23_k.jpg" isStereo="false" sphereParams="100,66,0,0"/>
<!-- 2015 -->
<photo src="https://c1.staticflickr.com/9/8728/17098966780_4f1ba46dbf_k.jpg" isStereo="false" sphereParams="50,33,90,-25">
<jump jumpTo="2015-a" sphereParams="25,33,90,-45">2015</jump>
<!-- 2013 -->
<photo src="https://c1.staticflickr.com/9/8546/8692786582_6793dab31e_k.jpg" isStereo="false" sphereParams="50,33,90,25">
<jump jumpTo="2013-a" sphereParams="25,33,90,5">2013</jump>
<!-- 2012 -->