Skip to content

Instantly share code, notes, and snippets.

View evu's full-sized avatar
🌎
>>> ▌

evu

🌎
>>> ▌
View GitHub Profile
@evu
evu / the_best_PS1.sh
Created September 12, 2019 17:55
the best PS1
export PS1="\[\e[1;34m\]\W\[\e[m\] \\$ "
@evu
evu / add_jupyter_kernel.sh
Created September 14, 2019 15:35
Add jupyter kernel for a virtualenv
#!/bin/bash
#
# Adds a jupyter kernel for a virtualenv
# This makes the virtualenv available for use in a Jupyter notebook
# Run this from the directory containing your virtualenv directory and
# pass it the directory name for your virtualenv.
#
# Usage:
# $ ./add_jupyter_kernel.sh myvenv
#
@evu
evu / saved_model_cli.sh
Last active September 21, 2019 17:01
saved_model_cli example
saved_model_cli show --dir /path/to/saved/model/1521687978/ --all
@evu
evu / snippet.py
Created November 16, 2019 00:59
Pandas DataFrame to tensorflow embedding projector .tsv
word_df.to_csv("words.tsv", sep="\t", header=False, index=False, quoting=csv.QUOTE_NONE, quotechar="", escapechar="\\")
vec_df.to_csv("vectors.tsv", sep="\t", header=False, index=False, quoting=csv.QUOTE_NONE, quotechar="", escapechar="\\")
@evu
evu / psycopg2_cheatsheet.md
Created January 30, 2020 18:33 — forked from pfigue/psycopg2_cheatsheet.md
psycopg2 Cheatsheet

Connect and Select

connect()

The shortest connect:

from psycopg2 import connect
psql_conn = connect("dbname=XXX user=XXX password=XXX host=localhost sslmode=require")
psql_conn.close()
@evu
evu / connect_to_postgres_with_psycopg2_and_pandas.py
Created February 18, 2020 14:56
Read from postgreSQL table into pandas dataframe using psycopg2 / sql query
import pandas as pd
import pandas.io.sql as pdsql
import psycopg2
# Database connection details
creds = {
"dbname": "mydb",
"user": "jsmith",
"password": "hello1234",
@evu
evu / zen.py
Created July 23, 2020 04:00
the zen of python
"""Do not let the zen slip through your fingers."""
import this
zen = "".join([this.d[x] if x.isalnum() else x for x in this.s])
@evu
evu / env.sh
Created October 1, 2020 03:20
env vars
CUDA_LAUNCH_BLOCKING=1
CUDA_VISIBLE_DEVICES=0,1,2,3
@evu
evu / enable_path
Created October 11, 2020 13:49
Permanently enable nautilus path (Ubuntu)
sudo apt install dconf-editor
dconf-editor
# Go to org > gnome > nautilus > preferences and check always-use-location-entry

Pansharpening notes, mid-2021

Preface

This is a collection of notes on how I’ve been approaching CNNs for pansharpening. It’s an edited version of an e-mail to a friend, who had asked about this tweet, and so it’s informal and somewhat silly; it is not as polished as, say, a blog post would be. Basically, what I’ve written up here is the advice I would give to an enthusiastic image processing hobbyist before they started working on pansharpening.

If you want a more serious brief review of the problem, try the first two pages of Learning deep multiresolution representations for pansharpening – most of the work I would recommend is mentioned there.

If you spot an error in the physics or math here, please mention it, but if you see a simplification or minor abuse of terminology, it’s on purpose; for textbook rigor, please refer to a textbook. The focus here is