Skip to content

Instantly share code, notes, and snippets.

View Ending2015a's full-sized avatar
🏠
Working from home

Ending Hsiao Ending2015a

🏠
Working from home
  • NTHU Elsa lab
  • NTHU
View GitHub Profile
@shelhamer
shelhamer / load_caffemodel.py
Last active November 9, 2020 00:46
Load binary proto .caffemodel to inspect layer names.
import sys
sys.path.insert(0, 'python/')
import caffe
from caffe.proto import caffe_pb2
net_param = caffe_pb2.NetParameter()
net_str = open('lenet_iter_5000.caffemodel', 'r').read()
net_param.ParseFromString(net_str)
print net_param.layer[0].name # first layer
@nickoala
nickoala / 0_python_email.md
Last active June 16, 2024 12:58
Use Python to send and receive emails

Use Python to:

  • send a plain text email
  • send an email with attachment
  • receive and filter emails according to some criteria
@TimothyRHuertas
TimothyRHuertas / frames.sh
Created June 20, 2017 23:24
Use ffmpeg to center crop and scale an image to 1:1
#Given a video of any aspect ratio this script will extract center cropped thumbnails at 299x299.
#Useful for gathering image training data.
#Assumes ffmpeg 3.3.2
#If you get an error about exact that means you are using an older version of ffmpeg
#Simply remove the :exact=1.
#This will make it work, but may cause the output size to be off by a pixel
#Script assumes you are downsampling.
#!/bin/bash
@TengdaHan
TengdaHan / ddp_notes.md
Last active July 2, 2024 06:39
Multi-node-training on slurm with PyTorch

Multi-node-training on slurm with PyTorch

What's this?

  • A simple note for how to start multi-node-training on slurm scheduler with PyTorch.
  • Useful especially when scheduler is too busy that you cannot get multiple GPUs allocated, or you need more than 4 GPUs for a single job.
  • Requirement: Have to use PyTorch DistributedDataParallel(DDP) for this purpose.
  • Warning: might need to re-factor your own code.
  • Warning: might be secretly condemned by your colleagues because using too many GPUs.
@eldrichgaiman
eldrichgaiman / tangela.svg
Created April 23, 2024 15:21
Tangela random tangle
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.