Skip to content

Instantly share code, notes, and snippets.

View ZekunZh's full-sized avatar

Zekun ZHANG ZekunZh

  • Gleamer.ai
  • PARIS, FRANCE
  • 22:39 (UTC +02:00)
View GitHub Profile
@ZekunZh
ZekunZh / Install NVIDIA Driver and CUDA.md
Last active November 5, 2018 15:11 — forked from zhanwenchen/Install NVIDIA Driver and CUDA.md
Install NVIDIA CUDA 9.0 on Ubuntu 16.04.4 LTS
@ZekunZh
ZekunZh / Clone original github repo, then change to the forked repo
Created November 15, 2018 10:06
Clone original github repo, then change to the forked repo
So you've cloned somebody's repo from github, but now you want to fork it and contribute back. Never fear!
Technically, when you fork "origin" should be your fork and "upstream" should be the project you forked; however, if you're willing to break this convention then it's easy.
* Off the top of my head *
1. Fork their repo on Github
2. In your local, add a new remote to your fork; then fetch it, and push your changes up to it
git remote add my-fork git@github...my-fork.git
@ZekunZh
ZekunZh / Delete-folders-in-a-time-interval.md
Last active May 31, 2019 15:41
Delete folders in a time interval with command line

First, list all folders in the time interval specified:

find the/root/folder/* -type d -newermt "2018-10-15 00:00:00" ! -newermt "2018-11-01 00:00:00" -ls

Second, delete all the folders!

  1. For empty folders:

find the/root/folder/* -type d -newermt 2018-10-15 ! -newermt 2018-11-01 -delete

@ZekunZh
ZekunZh / image_augmentation.py
Created November 22, 2018 11:23
Image augmentation on top of classical affine augmentations
class ImageBaseAug(object):
def __init__(self):
sometimes = lambda aug: iaa.Sometimes(0.5, aug)
self.seq = iaa.Sequential(
[
# Blur each image with varying strength using
# gaussian blur (sigma between 0 and 3.0),
# average/uniform blur (kernel size between 2x2 and 7x7)
# median blur (kernel size between 3x3 and 11x11).
iaa.OneOf([
@ZekunZh
ZekunZh / copy_all_except_one_folder.md
Created November 23, 2018 16:19
Copy all contents in one folder except one file/sub-folder

rsync -av --progress source_folder/* dest_folder/ --exclude folder_to_exclude/ -n

Use -n for dry run to see what will be copied, then remove -n to do real copy.

@ZekunZh
ZekunZh / verify_input_images_before_long_train.md
Last active November 26, 2018 18:01
One important lesson: Always verify input images of NN before starting a long train !

One important lesson: Always verify input images of NN before starting a long train !

Lesson 1: always verify input training images before you run a long training !

Lesson 2: always verify train losses during training !

Lesson 3: always verify predicted bboxes during evaluation !

Lesson 4: the devil lies in the smallest details, do not overlook small but meaningful signals !

@ZekunZh
ZekunZh / bodyparts.md
Last active November 30, 2018 13:37
A reasonable defination of interesting body parts for bone fractures

VALID_PARTS = ['ANKLE', 'ARM', 'CLAVICLE', 'ELBOW', 'FINGER', 'FOOT', 'FOREARMBONE', 'HAND', 'HIP', 'HUMERUS', 'KNEE', 'LEG', 'PATELLA', 'PELVIS', 'SHOULDER', 'WRIST']

Remove PELVIS and HIP for now, because of the limitation of images

az vm create --resource-group bushi-RG1 \
--name glm-bushi-2 --nics bushi-nic-2 \
--size Standard_DS1_v2 --os-type Linux \
--attach-os-disk glm-bushi-2 --attach-data-disks glm-bushi-disk-2 --plan-name linuxdsvmubuntu --plan-product linux-data-science-vm-ubuntu --plan-publisher microsoft-ads

ls | parallel -n2000 mkdir {#}\;mv {} {#}

-n2000 takes 2000 arguments at a time and {#} is the sequence number of the job.

Start from FP/FN

  1. For FP, find a sweet point of confidence threshold that corresponds to X (X=0.3) mean FP/study, in order to predict the bboxes that are possible missings in GT.

    Note : confidence threshold up -> mean FP/study down -> total FP down -> less time & effort, but can miss more good preds

  2. For FN, find a sweet point of confidence threshold that corresponds to X (X=?) mean FN/study, in order to show the GTs that are not detected / badly detected by the model.