Skip to content

Instantly share code, notes, and snippets.

View jin-zhe's full-sized avatar

Jin Zhe jin-zhe

View GitHub Profile
'''
Resizes images in source image directory within given size bounds (keeping
aspect ratio) and outputs in target directory with identical directory tree
structure. Uses Magick for image resizing.
'''
import os
import argparse
import subprocess
from pathlib import Path
@jin-zhe
jin-zhe / sshfr
Created May 10, 2023 08:07
Custom ssh command with port range forwarding
# STEP 1: `$ mkdir ~/bin`
# STEP 2: `$ touch ~/bin/sshfr`
# STEP 3: `$ chmod +x ~/bin/sshfr`
# STEP 4: Copy the following contents into `~/bin/sshfr`
# STEP 5: Update .profile or .bash_profle: `$ export PATH=$PATH":$HOME/bin"`
# STEP 6: Reload .profile or .bash_profle E.g. `$ . ~/.bash_profile`
# The contents of sshfr is as follows
ADDRESS=$1
PORT_START=${2-49151}
@jin-zhe
jin-zhe / edurec_scripts.py
Last active September 7, 2022 07:15
Script for EduRec exports
from datetime import datetime
import os
import pandas as pd
import argparse
'''
Note:
- Entries start on row 3 of EduRec excel exports
- 'Student Number' column is mandatory!
@jin-zhe
jin-zhe / split_pdfs.py
Created March 10, 2020 13:03
Python script to split a directory of pdfs into smaller pdfs
"""
Intended usage scenario:
You have a directory of pdfs, each comprising of sequential image scans of
human-annotated documents (e.g. written questionaries/forms/exams) where every
document share the same number of pages. Each pdf may contain different
numbers of such scanned documents. You want to split all these pdfs up into
smaller pdfs at fixed page index intervals such that each smaller pdf
correspond to a single scanned document. In addition, you want to place them
place them under a specific output directory while ensuring no filename
collisons.
@jin-zhe
jin-zhe / CS_paper_scaffold.md
Last active November 20, 2019 08:02
Scaffold for computer science paper

THIS IS A WORK IN PROGRESS

ABSTRACT

Summarize

  • What the problem is
  • What prior methods entail
  • What you propose/claim/hypothesize in this work
  • How/why is it better
  • Experimental support for your proposal
  • Any additonal insights (if applicable)
@jin-zhe
jin-zhe / actionrecognitiondatasets.md
Last active March 18, 2024 23:47
An overview of action recognition datasets and their detection classes

Activity Recognition Datasets

An overview of recent action recognition datasets and their detection classes

Concepts & terminologies:

  • Action: Atomic low-level movement such as standing up, sitting down, walking, talking etc.
  • Activity/event: Higher level occurence then actions such as dining, playing, dancing
  • Trimmed video: A short video clip containing event/action/activity of interest
  • Untrimmed video: A video clip of arbitrary length potentially containing durations without activities of interest
  • Localization: locating an instance of event/action/activity within a video at a spatial or temporal scale
  • Spatial localization: Locating the region/area of an instance of action/activity within a video