Skip to content

Instantly share code, notes, and snippets.

View salmedina's full-sized avatar
🎯
Focusing

Salvador Medina salmedina

🎯
Focusing
  • Carnegie Mellon University
  • Pittsburgh
View GitHub Profile
@jeasinema
jeasinema / weight_init.py
Last active May 25, 2023 09:32
A simple script for parameter initialization for PyTorch
#!/usr/bin/env python
# -*- coding:UTF-8 -*-
import torch
import torch.nn as nn
import torch.nn.init as init
def weight_init(m):
'''
#!/bin/bash
# MAYAVI SETUP
# mayavi is a python library for scientific visualisations, that can handle
# visualisation of Lidar Data. But, it can also be used to project Lidar data
# to 2D images.
#
# The set of commands I used to get mayavi set up on my computer so far.
# NOTE: I still do not know if it is set up properly, so this set of steps
# might be incomplete.
@michaelosthege
michaelosthege / convert.py
Last active February 28, 2024 22:16
Convert MP4/AVI clips to GIF with a single Python function
import imageio
import os, sys
class TargetFormat(object):
GIF = ".gif"
MP4 = ".mp4"
AVI = ".avi"
def convertFile(inputpath, targetFormat):
"""Reference: http://imageio.readthedocs.io/en/latest/examples.html#convert-a-movie"""
Byobu is a suite of enhancements to tmux, as a command line
tool providing live system status, dynamic window management,
and some convenient keybindings:
F1 * Used by X11 *
Shift-F1 Display this help
F2 Create a new window
Shift-F2 Create a horizontal split
Ctrl-F2 Create a vertical split
Ctrl-Shift-F2 Create a new session
""" Python implementation of the OASIS algorithm.
Graham Taylor
Based on Matlab implementation of:
Chechik, Gal, et al.
"Large scale online learning of image similarity through ranking."
The Journal of Machine Learning Research 11 (2010): 1109-1135.
"""
from __future__ import division
@savvot
savvot / ffmpeg-extract-keyframes.sh
Last active February 3, 2022 06:40
Extract only keyframes (I-frames) from video to images with console ffmpeg
ffmpeg -ss <start_time> -i video.mp4 -t <duration> -q:v 2 -vf select="eq(pict_type\,PICT_TYPE_I)" -vsync 0 frame%03d.jpg
@m14t
m14t / fix_github_https_repo.sh
Created July 5, 2012 21:57
Convert HTTPS github clones to use SSH
#/bin/bash
#-- Script to automate https://help.github.com/articles/why-is-git-always-asking-for-my-password
REPO_URL=`git remote -v | grep -m1 '^origin' | sed -Ene's#.*(https://[^[:space:]]*).*#\1#p'`
if [ -z "$REPO_URL" ]; then
echo "-- ERROR: Could not identify Repo url."
echo " It is possible this repo is already using SSH instead of HTTPS."
exit
fi